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;
@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");
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());
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());
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());
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());
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());
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());
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());
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());
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());
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) {