X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Fnorthbound.git;a=blobdiff_plain;f=generic-resource-api%2Fprovider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FPreloadNetworkTopologyRPCTest.java;h=6e0f1a2ee95612c5baea2c2ff275b8af6634db7e;hp=b05f1b27f2e6ad1afbfcd33ff1604602267ff5dd;hb=0e6f956f81b67e2e18c5972561552da55ea9838c;hpb=27b190ba58a8c66c7c807f7af3a72c2e0455401f diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PreloadNetworkTopologyRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PreloadNetworkTopologyRPCTest.java index b05f1b27..6e0f1a2e 100644 --- a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PreloadNetworkTopologyRPCTest.java +++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PreloadNetworkTopologyRPCTest.java @@ -7,8 +7,8 @@ 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.util.MDSALUtil.build; import static org.onap.sdnc.northbound.util.MDSALUtil.exec; -import static org.onap.sdnc.northbound.util.MDSALUtil.networkTopologyIdentifierBuilder; -import static org.onap.sdnc.northbound.util.MDSALUtil.networkTopologyInformationBuilder; +import static org.onap.sdnc.northbound.util.MDSALUtil.networkTopologyIdentifierStructureBuilder; +import static org.onap.sdnc.northbound.util.MDSALUtil.preloadNetworkTopologyInformationBuilder; import static org.onap.sdnc.northbound.util.MDSALUtil.preloadNetworkTopologyOperationInput; import static org.onap.sdnc.northbound.util.MDSALUtil.preloadNetworkTopologyOperationOutput; import static org.onap.sdnc.northbound.util.MDSALUtil.requestInformation; @@ -41,7 +41,7 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes } @Test - public void should_fail_when_invalid_vnf_topology() throws Exception { + public void should_fail_when_invalid_network_topology() throws Exception { PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput()); @@ -49,25 +49,7 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes exec(genericResourceApiProvider::preloadNetworkTopologyOperation, input, RpcResult::getResult); assertEquals("403", output.getResponseCode()); - assertEquals("input is null", output.getResponseMessage()); - assertEquals("Y", output.getAckFinalIndicator()); - } - - - @Test - public void should_fail_when_invalid_preload_data() throws Exception { - - PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput() - .setNetworkTopologyInformation(build(networkTopologyInformationBuilder() - .setNetworkTopologyIdentifier(build(networkTopologyIdentifierBuilder() - .setNetworkName("test-network-name"))))) - ); - - PreloadNetworkTopologyOperationOutput output = - exec(genericResourceApiProvider::preloadNetworkTopologyOperation, input, RpcResult::getResult); - - assertEquals("403", output.getResponseCode()); - assertEquals("invalid input: network-name or network-type is null or empty", output.getResponseMessage()); + assertEquals("invalid input, null or empty preload-network-topology-information", output.getResponseMessage()); assertEquals("Y", output.getAckFinalIndicator()); } @@ -76,11 +58,11 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes public void should_fail_when_client_execution_failed() throws Exception { svcClient.mockHasGraph(true); - svcClient.mockExecuteWoServiceData(new RuntimeException("test exception")); + svcClient.mockExecuteWoServiceDataPreload(new RuntimeException("test exception")); PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput() - .setNetworkTopologyInformation(build(networkTopologyInformationBuilder() - .setNetworkTopologyIdentifier(build(networkTopologyIdentifierBuilder() + .setPreloadNetworkTopologyInformation(build(preloadNetworkTopologyInformationBuilder() + .setNetworkTopologyIdentifierStructure(build(networkTopologyIdentifierStructureBuilder() .setNetworkName("test-network-name") .setNetworkType("test-network-type"))))) ); @@ -99,8 +81,8 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes svcClient.mockHasGraph(false); PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput() - .setNetworkTopologyInformation(build(networkTopologyInformationBuilder() - .setNetworkTopologyIdentifier(build(networkTopologyIdentifierBuilder() + .setPreloadNetworkTopologyInformation(build(preloadNetworkTopologyInformationBuilder() + .setNetworkTopologyIdentifierStructure(build(networkTopologyIdentifierStructureBuilder() .setNetworkName("test-network-name") .setNetworkType("test-network-type"))))) ); @@ -127,8 +109,8 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes genericResourceApiProvider.setDataBroker(spyDataBroker); PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput() - .setNetworkTopologyInformation(build(networkTopologyInformationBuilder() - .setNetworkTopologyIdentifier(build(networkTopologyIdentifierBuilder() + .setPreloadNetworkTopologyInformation(build(preloadNetworkTopologyInformationBuilder() + .setNetworkTopologyIdentifierStructure(build(networkTopologyIdentifierStructureBuilder() .setNetworkName("test-network-name") .setNetworkType("test-network-type"))))) ); @@ -149,8 +131,8 @@ public class PreloadNetworkTopologyRPCTest extends GenericResourceApiProviderTes svcClient.mockExecute(svcResultProp); PreloadNetworkTopologyOperationInput input = build(preloadNetworkTopologyOperationInput() - .setNetworkTopologyInformation(build(networkTopologyInformationBuilder() - .setNetworkTopologyIdentifier(build(networkTopologyIdentifierBuilder() + .setPreloadNetworkTopologyInformation(build(preloadNetworkTopologyInformationBuilder() + .setNetworkTopologyIdentifierStructure(build(networkTopologyIdentifierStructureBuilder() .setNetworkName("test-network-name") .setNetworkType("test-network-type"))))) .setSdncRequestHeader(build(sdncRequestHeader()