diff options
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java index 5b631a643..4e0e70e89 100644 --- a/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiOverTLSClientTest.java @@ -33,11 +33,13 @@ import org.mockito.runners.MockitoJUnitRunner; import org.onap.vid.aai.model.AaiNodeQueryResponse; import org.onap.vid.aai.model.ResourceType; import org.onap.vid.client.SyncRestClient; +import org.onap.vid.model.SubscriberList; @RunWith(MockitoJUnitRunner.class) public class AaiOverTLSClientTest { - public static final String SEARCH_NODES_QUERY_SEARCH_NODE_TYPE = "search/nodes-query?search-node-type=generic-vnf&filter=vnf-name:EQUALS:name"; + private static final String SEARCH_NODES_QUERY_SEARCH_NODE_TYPE = "search/nodes-query?search-node-type=generic-vnf&filter=vnf-name:EQUALS:name"; + private static final String SUBSCRIBERS = "business/customers?subscriber-type=INFRA&depth=0"; private AaiOverTLSClient aaiRestClient; @Mock @@ -51,7 +53,7 @@ public class AaiOverTLSClientTest { } @Test - public void searchNodeTypeByName() { + public void testSearchNodeTypeByName() { mockPropertyReader(); aaiRestClient.searchNodeTypeByName("name", ResourceType.GENERIC_VNF); @@ -59,6 +61,15 @@ public class AaiOverTLSClientTest { Matchers.eq(getHeaders()), Matchers.eq(Collections.emptyMap()), Matchers.eq(AaiNodeQueryResponse.class)); } + @Test + public void testGetAllSubscribers(){ + mockPropertyReader(); + + aaiRestClient.getAllSubscribers(); + Mockito.verify(syncRestClient).get(Matchers.contains(SUBSCRIBERS), + Matchers.eq(getHeaders()), Matchers.eq(Collections.emptyMap()), Matchers.eq(SubscriberList.class)); + } + private void mockPropertyReader() { Mockito.when(propertySupplier.getPassword()).thenReturn("Pass"); Mockito.when(propertySupplier.getUsername()).thenReturn("User"); |