From a9f86b8996c3dfb880098691048686a37ac40dd0 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 11 Jan 2019 21:07:06 -0500 Subject: get subnet sequence number from A&AI Add AAIQuery for subnet block to CreateNetwork bpmn MSO shall get subnet sequence number. Change-Id: I5cf73d1b5344f41ac98a51274948822322e3591b Issue-ID: SO-1378 Signed-off-by: Benjamin, Max (mb388a) --- .../client/orchestration/AAINetworkResourcesTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bpmn/so-bpmn-tasks/src/test/java') diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java index 6b33440bd7..2efdbde28b 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java @@ -340,4 +340,21 @@ public class AAINetworkResourcesTest extends TestDataSetup{ eq(AAIUriFactory.createResourceUri(AAIObjectType.CLOUD_REGION, cloudRegion.getCloudOwner(), cloudRegion.getLcpCloudRegionId())), eq(AAIEdgeLabel.USES)); } + + @Test + public void getSubnetTest() throws Exception { + final String content = new String(Files.readAllBytes(Paths.get(JSON_FILE_LOCATION + "aaiSubnetsMapped_to_aai.json"))); + AAIResultWrapper aaiResultWrapper = new AAIResultWrapper(content); + Optional oSubnet = Optional.empty(); + AAIResourceUri subnetUri = AAIUriFactory.createResourceUri(AAIObjectType.SUBNET, "ModelInvariantUUID", "serviceModelVersionId"); + + doReturn(aaiResultWrapper).when(MOCK_aaiResourcesClient).get(isA(AAIResourceUri.class)); + oSubnet = aaiNetworkResources.getSubnet(subnetUri); + verify(MOCK_aaiResourcesClient, times(1)).get(any(AAIResourceUri.class)); + + if (oSubnet.isPresent()) { + org.onap.aai.domain.yang.Subnet subnet = oSubnet.get(); + assertThat(aaiResultWrapper.asBean(org.onap.aai.domain.yang.Subnet.class).get(), sameBeanAs(subnet)); + } + } } -- cgit 1.2.3-korg