From 58709fc696d250f4f4358c036bc8dfd7d7ef1fab Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 22 Jan 2019 11:56:59 -0500 Subject: Removed deprecated Matcher imports replaced org.mockito.Matchers with ArgumentMatchers Change-Id: I2feb4d4fb314cd14aca0719c4cc29b1a0510cbf7 Issue-ID: SO-1413 Signed-off-by: Benjamin, Max (mb388a) --- .../apihandler/common/CamundaTaskClientTest.java | 2 +- .../exceptions/ApiExceptionMapperTest.java | 4 +-- .../GlobalHealthcheckHandlerTest.java | 32 +++++++++++----------- .../ModelDistributionRequestTest.java | 4 +-- .../helpers/AAIClientHelperTest.java | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'mso-api-handlers') diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaTaskClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaTaskClientTest.java index f1b46e7b50..2ba0e4a173 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaTaskClientTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandler/common/CamundaTaskClientTest.java @@ -21,7 +21,7 @@ package org.onap.so.apihandler.common; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java index 06459a2f0a..1962f00d52 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapperTest.java @@ -26,8 +26,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.StringStartsWith.startsWith; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java index f7e605bcc5..45fadb540a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandlerTest.java @@ -24,10 +24,10 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.anyString; import java.net.URI; import java.util.Collections; import java.util.List; @@ -46,7 +46,7 @@ import org.json.JSONException; import org.junit.Rule; import org.junit.Test; import org.mockito.InjectMocks; -import org.mockito.Matchers; +import org.mockito.ArgumentMatchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; @@ -74,10 +74,10 @@ public class GlobalHealthcheckHandlerTest { ReflectionTestUtils.setField(globalhealth, "actuatorContextPath", "/manage"); ReflectionTestUtils.setField(globalhealth, "endpointBpmn", "http://localhost:8080"); - Mockito.when(restTemplate.exchange(Matchers.any(URI.class), - Matchers.any(HttpMethod.class), - Matchers.> any(), - Matchers.> any())).thenReturn(null); + Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), + ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.> any(), + ArgumentMatchers.> any())).thenReturn(null); String result = globalhealth.querySubsystemHealth(MsoSubsystems.BPMN); System.out.println(result); @@ -93,10 +93,10 @@ public class GlobalHealthcheckHandlerTest { subSystemResponse.setStatus("UP"); ResponseEntity r = new ResponseEntity<>(subSystemResponse,HttpStatus.OK); - Mockito.when(restTemplate.exchange(Matchers.any(URI.class), - Matchers.any(HttpMethod.class), - Matchers.> any(), - Matchers.> any())).thenReturn(r); + Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), + ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.> any(), + ArgumentMatchers.> any())).thenReturn(r); String result = globalhealth.querySubsystemHealth(MsoSubsystems.ASDC); System.out.println(result); @@ -117,10 +117,10 @@ public class GlobalHealthcheckHandlerTest { subSystemResponse.setStatus(status); ResponseEntity r = new ResponseEntity<>(subSystemResponse,HttpStatus.OK); - Mockito.when(restTemplate.exchange(Matchers.any(URI.class), - Matchers.any(HttpMethod.class), - Matchers.> any(), - Matchers.> any())).thenReturn(r); + Mockito.when(restTemplate.exchange(ArgumentMatchers.any(URI.class), + ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.> any(), + ArgumentMatchers.> any())).thenReturn(r); Mockito.when(requestContext.getProperty(anyString())).thenReturn("1234567890"); Response response = globalhealth.globalHealthcheck(true, requestContext); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java index afcf0f54c8..9a8f4880f7 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequestTest.java @@ -26,8 +26,8 @@ import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.contains; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.contains; import static org.mockito.Mockito.doNothing; import javax.inject.Provider; diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/AAIClientHelperTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/AAIClientHelperTest.java index f9e3ec6498..0a57b4f245 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/AAIClientHelperTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/AAIClientHelperTest.java @@ -29,7 +29,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; -- cgit 1.2.3-korg