Update third party versions in ccsdk/apps
[ccsdk/apps.git] / ms / neng / src / test / java / org / onap / ccsdk / apps / ms / neng / service / extinf / impl / PolicyFinderServiceImplTest.java
index e31c098..8831118 100644 (file)
@@ -37,11 +37,11 @@ import java.util.Map;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.InjectMocks;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.Spy;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.ccsdk.apps.ms.neng.core.exceptions.NengException;
 import org.onap.ccsdk.apps.ms.neng.core.resource.model.GetConfigRequest;
 import org.onap.ccsdk.apps.ms.neng.core.resource.model.GetConfigResponse;
@@ -72,14 +72,14 @@ public class PolicyFinderServiceImplTest {
     @Test
     public void testConfig() throws Exception {
         doReturn(new GetConfigResponse()).when(policyFinder).makeOutboundCall( 
-            Matchers.any(), Matchers.any(), Matchers.any());
+            ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any());
         assertNotNull(policyFinder.getConfig("policy"));
     }
     
     @Test
     public void testFindPolicy() throws Exception {
         doReturn(new GetConfigResponse()).when(policyFinder).makeOutboundCall( 
-            Matchers.any(), Matchers.any(), Matchers.any());
+            ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any());
         assertNull(policyFinder.findPolicy("policy"));
     }
 
@@ -96,7 +96,7 @@ public class PolicyFinderServiceImplTest {
         Map<String, Object> configMap = buildPolicyResponse();
         Object resp = Arrays.asList(new Object[] {configMap});
         ResponseEntity<Object> respEn = new ResponseEntity<>(resp, HttpStatus.OK);
-        Mockito.lenient().when(restTemplate.exchange(Matchers.any(RequestEntity.class), Matchers.any(Class.class))).thenReturn(respEn);
+        Mockito.lenient().when(restTemplate.exchange(ArgumentMatchers.any(RequestEntity.class), ArgumentMatchers.any(Class.class))).thenReturn(respEn);
 
         policManProps.setUrl("http://policyManager.onap.org");
 
@@ -112,7 +112,7 @@ public class PolicyFinderServiceImplTest {
         Map<String, Object> configMap = buildPolicyResponse();
         Object resp = Arrays.asList(new Object[] {configMap});
         ResponseEntity<Object> respEn = new ResponseEntity<>(resp, HttpStatus.INTERNAL_SERVER_ERROR);
-        Mockito.lenient().when(restTemplate.exchange(Matchers.any(RequestEntity.class), Matchers.any(Class.class))).thenReturn(respEn);
+        Mockito.lenient().when(restTemplate.exchange(ArgumentMatchers.any(RequestEntity.class), ArgumentMatchers.any(Class.class))).thenReturn(respEn);
 
         policManProps.setUrl("http://policyManager.onap.org");
 
@@ -224,7 +224,7 @@ public class PolicyFinderServiceImplTest {
     @Test(expected = NengException.class)
     public void testmakeOutboundCall_500_statusExp() throws Exception {
         HttpClientErrorException exp = new HttpClientErrorException(HttpStatus.METHOD_NOT_ALLOWED, "{error}");
-        Mockito.lenient().when(restTemplate.exchange(Matchers.any(RequestEntity.class), Matchers.any(Class.class))).thenThrow(exp);
+        Mockito.lenient().when(restTemplate.exchange(ArgumentMatchers.any(RequestEntity.class), ArgumentMatchers.any(Class.class))).thenThrow(exp);
         policManProps.setUrl("http://policyManager.onap.org");
         GetConfigRequest request = new GetConfigRequest();
         request.setPolicyName("policy");
@@ -235,7 +235,7 @@ public class PolicyFinderServiceImplTest {
     @Test(expected = NengException.class)
     public void testmakeOutboundCall_500_statusExp_notFound() throws Exception {
         HttpClientErrorException exp = new HttpClientErrorException(HttpStatus.NOT_FOUND, "{error}");
-        Mockito.lenient().when(restTemplate.exchange(Matchers.any(RequestEntity.class), Matchers.any(Class.class))).thenThrow(exp);
+        Mockito.lenient().when(restTemplate.exchange(ArgumentMatchers.any(RequestEntity.class), ArgumentMatchers.any(Class.class))).thenThrow(exp);
         policManProps.setUrl("http://policyManager.onap.org");
         GetConfigRequest request = new GetConfigRequest();
         request.setPolicyName("policy");