summaryrefslogtreecommitdiffstats
path: root/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
diff options
context:
space:
mode:
authorDenes Nemeth <denes.nemeth@nokia.com>2018-05-07 22:53:42 +0200
committerDenes Nemeth <denes.nemeth@nokia.com>2018-05-07 23:00:23 +0200
commit8d392994c5c6867779158ed4a18113f92b0cf5e7 (patch)
treea8c4ea6cafd0ed61396d446a57415c2b98bbd968 /nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
parent7ad528140eb987b2a7d66453b13e820a2d782245 (diff)
Fix grant manager initialization
Change-Id: I3bacfd83caa05b4cdcb74edc787834d3e34e0873 Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com> Issue-ID: VFC-728
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java')
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
index 14e764c9..ae58af91 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/vnfm/TestLifecycleManager.java
@@ -390,6 +390,7 @@ public class TestLifecycleManager extends TestBase {
/**
* test instantiation with backward compatibility test with Amsterdam release
* - the vim identifier is supplied as vimid with not camel case
+ * - the access info is supplied as accessinfo with not camel case
*/
@Test
public void testInstantiationNoVimId() throws Exception {
@@ -777,7 +778,33 @@ public class TestLifecycleManager extends TestBase {
assertEquals(0, actualInstantiationRequest.getAllValues().size());
//verify
verify(logger).error("VF-C did not send VIM identifier in grant response");
+ }
+
+ /**
+ * instantiation fails if VF-C does not send access info in grant response
+ */
+ @Test
+ public void testVfcFailsToSendAccessInfo() throws Exception {
+ VnfInstantiateRequest instantiationRequest = prepareInstantiationRequest(VimInfo.VimInfoTypeEnum.OPENSTACK_V2_INFO);
+ when(vnfApi.vnfsPost(createRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(vnfInfo));
+ additionalParam.setInstantiationLevel(INSTANTIATION_LEVEL);
+ when(vfcGrantManager.requestGrantForInstantiate(VNFM_ID, VNF_ID, VIM_ID, ONAP_CSAR_ID, INSTANTIATION_LEVEL, cbamVnfdContent, JOB_ID)).thenReturn(grantResponse);
+ grantResponse.setVimId(VIM_ID);
+ GrantVNFResponseVimAccessInfo accessInfo = new GrantVNFResponseVimAccessInfo();
+ accessInfo.setTenant(TENANT);
+ String caCert = new String(readAllBytes(Paths.get(TestVfcGrantManager.class.getResource("/unittests/localhost.cert.pem").toURI())));
+ vimInfo.setSslInsecure("false");
+ vimInfo.setSslCacert(caCert);
+ //grantResponse.setAccessInfo(accessInfo);
+ ArgumentCaptor<InstantiateVnfRequest> actualInstantiationRequest = ArgumentCaptor.forClass(InstantiateVnfRequest.class);
+ when(vnfApi.vnfsVnfInstanceIdInstantiatePost(eq(VNF_ID), actualInstantiationRequest.capture(), eq(NOKIA_LCM_API_VERSION))).thenReturn(buildObservable(instantiationOperationExecution));
+ //when
+ VnfInstantiateResponse response = lifecycleManager.createAndInstantiate(VNFM_ID, instantiationRequest, restResponse);
+ waitForJobToFinishInJobManager(finished);
+ assertEquals(0, actualInstantiationRequest.getAllValues().size());
+ //verify
+ verify(logger).error("VF-C did not send access info in grant response");
}
/**