diff options
author | Steve Smokowski <ss835w@att.com> | 2019-01-12 13:16:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-12 13:16:21 +0000 |
commit | c3830202743f9d8ec861c6b2a0b434f76e30124a (patch) | |
tree | 4f2f783520c7aff5d29f7cc93b6b0e05d7adc7a9 /bpmn/so-bpmn-tasks/src/test/java/org | |
parent | efb42bcc116535dad00c23a39fccdc5f9e5c321a (diff) | |
parent | a9f86b8996c3dfb880098691048686a37ac40dd0 (diff) |
Merge "get subnet sequence number from A&AI"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/test/java/org')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/AAINetworkResourcesTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
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<org.onap.aai.domain.yang.Subnet> 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)); + } + } } |