summaryrefslogtreecommitdiffstats
path: root/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc
diff options
context:
space:
mode:
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc')
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java7
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java24
2 files changed, 14 insertions, 17 deletions
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
index b9d44603..f1ed1e16 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcGrantManager.java
@@ -28,10 +28,9 @@ import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CatalogManager;
+import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CatalogManagerForVfc;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.LifecycleManager;
import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
import org.onap.vnfmdriver.model.*;
@@ -50,8 +49,7 @@ public class TestVfcGrantManager extends TestBase {
private GrantVNFResponseVim vim = new GrantVNFResponseVim();
private GrantVNFResponse grantResponse = new GrantVNFResponse();
@Mock
- private CatalogManager cbamCatalogManager;
- @InjectMocks
+ private CatalogManagerForVfc cbamCatalogManager;
private VfcGrantManager vfcGrantManager;
@Before
@@ -59,6 +57,7 @@ public class TestVfcGrantManager extends TestBase {
setField(VfcGrantManager.class, "logger", logger);
when(nsLcmApi.grantvnf(grantRequest.capture())).thenReturn(buildObservable(grantResponse));
grantResponse.setVim(vim);
+ vfcGrantManager = new VfcGrantManager(cbamCatalogManager, cbamRestApiProviderForVfc, vfcRestApiProvider);
}
/**
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
index ded1bcd9..06cb6434 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/onap/vfc/TestVfcNotificationSender.java
@@ -42,8 +42,6 @@ import static java.util.Optional.empty;
import static java.util.Optional.of;
import static junit.framework.TestCase.*;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.*;
import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.CbamRestApiProvider.NOKIA_LCM_API_VERSION;
import static org.springframework.test.util.ReflectionTestUtils.setField;
@@ -62,7 +60,7 @@ public class TestVfcNotificationSender extends TestBase {
@Before
public void init() throws Exception {
- vfcNotificationSender = new VfcNotificationSender(driverProperties, vfcRestApiProvider);
+ vfcNotificationSender = new VfcNotificationSender(vfcRestApiProvider);
setField(VfcNotificationSender.class, "logger", logger);
when(nsLcmApi.vNFLCMNotification(eq(VNFM_ID), eq(VNF_ID), sentLcnToVfc.capture())).thenReturn(null);
instantiationOperation.setId("instantiationOperationExecutionId");
@@ -114,7 +112,7 @@ public class TestVfcNotificationSender extends TestBase {
recievedLcn.setStatus(OperationStatus.STARTED);
recievedLcn.setOperation(OperationType.INSTANTIATE);
//when
- vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, empty(), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, empty(), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
assertNull(sentLcnToVfc.getValue().getAffectedVl());
@@ -188,7 +186,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
instantiationOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -271,7 +269,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
instantiationOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -352,7 +350,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
instantiationOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, terminationOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, terminationOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -473,7 +471,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
instantiationOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, healOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, healOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -585,7 +583,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
scaleOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, scaleOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, scaleOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -698,7 +696,7 @@ public class TestVfcNotificationSender extends TestBase {
scaleOperation.setAdditionalData(additionalData);
scaleOperation.setOperationType(OperationType.SCALE);
//when
- vfcNotificationSender.processNotification(recievedLcn, scaleOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, scaleOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -762,7 +760,7 @@ public class TestVfcNotificationSender extends TestBase {
scaleOperation.setOperationType(OperationType.SCALE);
when(logger.isInfoEnabled()).thenReturn(false);
//when
- vfcNotificationSender.processNotification(recievedLcn, scaleOperation, empty(), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, scaleOperation, empty(), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -821,7 +819,7 @@ public class TestVfcNotificationSender extends TestBase {
JsonElement additionalData = new Gson().toJsonTree(operationResult);
instantiationOperation.setAdditionalData(additionalData);
//when
- vfcNotificationSender.processNotification(recievedLcn, healOperation, of(affectedConnectionPoints), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, healOperation, of(affectedConnectionPoints), VIM_ID, VNFM_ID);
//verify
assertEquals(1, sentLcnToVfc.getAllValues().size());
@@ -846,7 +844,7 @@ public class TestVfcNotificationSender extends TestBase {
recievedLcn.setOperation(OperationType.INSTANTIATE);
//when
try {
- vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, empty(), VIM_ID);
+ vfcNotificationSender.processNotification(recievedLcn, instantiationOperation, empty(), VIM_ID, VNFM_ID);
//verify
fail();
} catch (Exception e) {