import static org.onap.sdnc.northbound.GenericResourceApiProvider.APP_NAME;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NO_SERVICE_LOGIC_ACTIVE;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NULL_OR_EMPTY_ERROR_PARAM;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.APP_NAME;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NO_SERVICE_LOGIC_ACTIVE;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NULL_OR_EMPTY_ERROR_PARAM;
import static org.onap.sdnc.northbound.util.MDSALUtil.exec;
import static org.onap.sdnc.northbound.util.MDSALUtil.requestInformation;
import static org.onap.sdnc.northbound.util.MDSALUtil.sdncRequestHeader;
import static org.onap.sdnc.northbound.util.MDSALUtil.exec;
import static org.onap.sdnc.northbound.util.MDSALUtil.requestInformation;
import static org.onap.sdnc.northbound.util.MDSALUtil.sdncRequestHeader;
@Test
public void should_fail_when_service_info_not_present() throws Exception {
// create the ServiceTopologyOperationInput from the template
@Test
public void should_fail_when_service_info_not_present() throws Exception {
// create the ServiceTopologyOperationInput from the template
- .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance)
- ))
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("service-instance-id: xyz")
- ))
- );
+ .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance).build()
+ )
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("service-instance-id: xyz").build()
+ ).build();
- .setRequestAction(RequestInformation.RequestAction.DeleteServiceInstance)
- ))
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("service-instance-id: xyz")
- ))
- );
+ .setRequestAction(RequestInformation.RequestAction.DeleteServiceInstance).build()
+ )
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("service-instance-id: xyz").build()
+ ).build();
- .setRequestAction(RequestInformation.RequestAction.DeleteServiceInstance)
- ))
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("service-instance-id: xyz")
- ))
- );
+ .setRequestAction(RequestInformation.RequestAction.DeleteServiceInstance).build()
+ )
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("service-instance-id: xyz").build()
+ ).build();
}
private ServiceTopologyOperationOutput createExpectedSTOO(PropBuilder expectedSvcResultProp,
ServiceTopologyOperationInput expectedServiceTopologyOperationInput) {
}
private ServiceTopologyOperationOutput createExpectedSTOO(PropBuilder expectedSvcResultProp,
ServiceTopologyOperationInput expectedServiceTopologyOperationInput) {
serviceTopologyOperationOutput()
.setSvcRequestId(expectedServiceTopologyOperationInput.getSdncRequestHeader().getSvcRequestId())
.setResponseCode(expectedSvcResultProp.get(svcClient.errorCode))
.setAckFinalIndicator(expectedSvcResultProp.get(svcClient.ackFinal))
.setResponseMessage(expectedSvcResultProp.get(svcClient.errorMessage))
serviceTopologyOperationOutput()
.setSvcRequestId(expectedServiceTopologyOperationInput.getSdncRequestHeader().getSvcRequestId())
.setResponseCode(expectedSvcResultProp.get(svcClient.errorCode))
.setAckFinalIndicator(expectedSvcResultProp.get(svcClient.ackFinal))
.setResponseMessage(expectedSvcResultProp.get(svcClient.errorMessage))
ServiceInformation expectedServiceInformation = expectedServiceTopologyOperationInput.getServiceInformation();
RequestInformation expectedRequestInformation = expectedServiceTopologyOperationInput.getRequestInformation();
ServiceInformation expectedServiceInformation = expectedServiceTopologyOperationInput.getServiceInformation();
RequestInformation expectedRequestInformation = expectedServiceTopologyOperationInput.getRequestInformation();
serviceStatus()
.setAction(expectedRequestInformation.getRequestAction().name())
.setFinalIndicator(expectedServiceTopologyOperationOutput.getAckFinalIndicator())
serviceStatus()
.setAction(expectedRequestInformation.getRequestAction().name())
.setFinalIndicator(expectedServiceTopologyOperationOutput.getAckFinalIndicator())
.setRpcAction(toRpcAction(expectedSdncRequestHeader.getSvcAction()))
.setRpcName(SVC_OPERATION)
.setRequestStatus(ServiceStatus.RequestStatus.Synccomplete)
.setRpcAction(toRpcAction(expectedSdncRequestHeader.getSvcAction()))
.setRpcName(SVC_OPERATION)
.setRequestStatus(ServiceStatus.RequestStatus.Synccomplete)