summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmichai Hemli <amichai.hemli@intl.att.com>2019-09-09 11:11:52 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-09 11:11:52 +0000
commit4edd50d4d8192a68c0bc6ee19d443c82ebf22379 (patch)
treed4f6f0b0de7eef2fd850edcfa68118aaad5983f9
parente1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (diff)
parentaf88d413093778f9102080e32ebbd3071c81f61d (diff)
Merge "Stabilize AAIServiceTreeIntegrativeTest, assuming a Mocking issue"
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AAIServiceTreeIntegrativeTest.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AAIServiceTreeIntegrativeTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AAIServiceTreeIntegrativeTest.java
index 00a9995cb..e5799bcf0 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/AAIServiceTreeIntegrativeTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AAIServiceTreeIntegrativeTest.java
@@ -40,9 +40,7 @@ import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.ws.rs.core.Response;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.onap.vid.aai.AaiClientInterface;
import org.onap.vid.aai.ExceptionWithRequestInfo;
@@ -58,7 +56,6 @@ import org.onap.vid.model.aaiTree.ServiceInstance;
import org.onap.vid.model.aaiTree.Vnf;
import org.onap.vid.testUtils.TestUtils;
import org.springframework.http.HttpMethod;
-import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -79,11 +76,9 @@ public class AAIServiceTreeIntegrativeTest {
@Mock
ServiceModelInflator serviceModelInflator;
- @InjectMocks
private AAITreeNodeBuilder aaiTreeNodeBuilder;
- @InjectMocks
- private AAITreeConverter aaiTreeConverter;
+ private AAITreeConverter aaiTreeConverter = new AAITreeConverter();
private ExecutorService executorService = Executors.newFixedThreadPool(10);
@@ -295,17 +290,17 @@ public class AAIServiceTreeIntegrativeTest {
"\"property-key\": \"model-ver.model-name\"," +
"\"property-value\": \"service-instance\"}]}]}}]}}]}}]}";
- @BeforeClass
+ @BeforeMethod
public void initMocks() {
+ aaiClient = null;
+ aaiGetVersionByInvariantIdResponse = null;
+ sdcService = null;
+ serviceModelInflator = null;
+ exceptionWithRequestInfo = null;
+
MockitoAnnotations.initMocks(this);
- }
- @BeforeMethod
- public void resetMocks() {
- Mockito.reset(aaiClient);
- Mockito.reset(aaiGetVersionByInvariantIdResponse);
- Mockito.reset(sdcService);
- Mockito.reset(serviceModelInflator);
+ aaiTreeNodeBuilder = new AAITreeNodeBuilder(aaiClient);
}
public void getServiceInstanceTreeAndAssert(boolean isDuplicatedKeysInTenantRelation) throws IOException, AsdcCatalogException {