Naming micro-service - upgrade to spring-boot-2.
[ccsdk/apps.git] / ms / neng / src / test / java / org / onap / ccsdk / apps / ms / neng / core / gen / NameGeneratorDependencyOnUnnamedTest.java
index be24340..b9b781b 100644 (file)
@@ -35,6 +35,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
+import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.runners.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
@@ -69,9 +70,9 @@ public class NameGeneratorDependencyOnUnnamedTest {
      */
     @Before
     public void setupPolicyParams() throws Exception {
-        when(policyParams.mapFunction("substr")).thenReturn("substring");
-        when(policyParams.mapFunction("to_lower_case")).thenReturn("toLowerCase");
-        when(policyParams.mapFunction("to_upper_case")).thenReturn("toUpperCase");
+        Mockito.lenient().when(policyParams.mapFunction("substr")).thenReturn("substring");
+        Mockito.lenient().when(policyParams.mapFunction("to_lower_case")).thenReturn("toLowerCase");
+        Mockito.lenient().when(policyParams.mapFunction("to_upper_case")).thenReturn("toUpperCase");
     }
 
     protected Map<String, String> makeVmRequest(String policy) {
@@ -92,10 +93,10 @@ public class NameGeneratorDependencyOnUnnamedTest {
         allElements.add(requestElement2);
 
         Map<String, Object> policy = new FilePolicyReader("vnf_and_vm_policy.json").getPolicy();
-        when(policyFinder.findPolicy(policyName)).thenReturn(policy);
-        when(aaiValidator.validate(anyObject(), anyObject())).thenReturn(true);
-        when(dbValidator.validate(anyObject(), anyObject())).thenReturn(true);
-        when(sequenceGenerator.generate(anyObject(), anyObject(), anyObject(), anyObject(), anyInt())).thenReturn(1L);
+        Mockito.lenient().when(policyFinder.findPolicy(policyName)).thenReturn(policy);
+        Mockito.lenient().when(aaiValidator.validate(anyObject(), anyObject())).thenReturn(true);
+        Mockito.lenient().when(dbValidator.validate(anyObject(), anyObject())).thenReturn(true);
+        Mockito.lenient().when(sequenceGenerator.generate(anyObject(), anyObject(), anyObject(), anyObject(), anyInt())).thenReturn(1L);
 
         final List<Object> savedNames = new ArrayList<>();
         doAnswer(new Answer<Void>() {