File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
ambari-server/src/test/java/org/apache/ambari/server/checks Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -227,16 +227,16 @@ public void testPerform() throws Exception {
227227 public void testPerformFail () throws Exception {
228228 AmbariManagementController ambariManagementControllerMock = Mockito .mock (AmbariManagementController .class );
229229 PowerMockito .mockStatic (AmbariServer .class );
230- when (AmbariServer .getController ()).thenReturn ( ambariManagementControllerMock );
230+ when (AmbariServer .getController ()).thenAnswer ( invocation -> ambariManagementControllerMock );
231231
232232 ResourceProvider resourceProviderMock = mock (ResourceProvider .class );
233233 PowerMockito .mockStatic (AbstractControllerResourceProvider .class );
234- when (AbstractControllerResourceProvider .getResourceProvider (Mockito .eq (Resource .Type .Request ), any (AmbariManagementController .class ))).thenReturn ( resourceProviderMock );
234+ when (AbstractControllerResourceProvider .getResourceProvider (Mockito .eq (Resource .Type .Request ), any (AmbariManagementController .class ))).thenAnswer ( invocation -> resourceProviderMock );
235235
236236 PowerMockito .mockStatic (PropertyHelper .class );
237237 Request requestMock = mock (Request .class );
238- when (PropertyHelper .getCreateRequest (any (), any ())).thenReturn ( requestMock );
239- when (PropertyHelper .getPropertyId ("Requests" , "id" )).thenReturn ( "requestIdProp" );
238+ when (PropertyHelper .getCreateRequest (any (), any ())).thenAnswer ( invocation -> requestMock );
239+ when (PropertyHelper .getPropertyId ("Requests" , "id" )).thenAnswer ( invocation -> "requestIdProp" );
240240
241241 RequestStatus requestStatusMock = mock (RequestStatus .class );
242242 Resource responseResourceMock = mock (Resource .class );
You can’t perform that action at this time.
0 commit comments