aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-09-08 21:42:11 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-08 21:42:11 +0300
commitaf88d413093778f9102080e32ebbd3071c81f61d (patch)
tree44a4f3bc523d2be377009c8fcf108616808575ef /vid-app-common/src
parente25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff)
Stabilize AAIServiceTreeIntegrativeTest, assuming a Mocking issue
Change-Id: Ia90b5b4cb9fd2d5203df74bea9cb5618d2dd37e7 Issue-ID: VID-378 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src')
-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 {