use of org.onap.aaiclient.client.graphinventory.entities.uri.HttpAwareUri in project so by onap.
the class ServiceInstanceUriTest method oneKeyClone.
@Test
public void oneKeyClone() throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
String uri = "/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3";
doReturn(Optional.of(uri)).when(spy).getCachedValue();
final URI result = ((HttpAwareUri) spy.resourceVersion("1234").clone()).locateAndBuild();
final URI expected = UriBuilder.fromUri("/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3?resource-version=1234").build();
assertEquals("result is equal", expected, result);
}
use of org.onap.aaiclient.client.graphinventory.entities.uri.HttpAwareUri in project so by onap.
the class ServiceInstanceUriTest method oneKeyQueryParams.
@Test
public void oneKeyQueryParams() throws IOException, URISyntaxException, GraphInventoryUriNotFoundException, GraphInventoryPayloadException {
ServiceInstanceUri instance = new ServiceInstanceUri(Types.SERVICE_INSTANCE.getFragment("key1"));
ServiceInstanceUri spy = spy(instance);
doReturn("/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3").when(spy).getObjectById(any(Object.class));
final URI result = ((HttpAwareUri) spy.resourceVersion("1234")).locateAndBuild();
final URI expected = UriBuilder.fromUri("/business/customers/customer/key1/service-subscriptions/service-subscription/key2/service-instances/service-instance/key3?resource-version=1234").build();
assertEquals("result is equal", expected, result);
}
Aggregations