use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.
the class AAINetworkResourcesTest method checkInstanceGroupNameInUseTrueTest.
@Test
public void checkInstanceGroupNameInUseTrueTest() throws Exception {
AAIPluralResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Networks()).queryParam("network-name", "networkName");
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri));
boolean nameInUse = aaiNetworkResources.checkNetworkNameInUse("networkName");
assertTrue(nameInUse);
}
use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.
the class AAIServiceInstanceResourcesTest method checkInstanceServiceNameInUseFalseTest.
@Test
public void checkInstanceServiceNameInUseFalseTest() throws Exception {
AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment()).queryParam("service-instance-name", serviceInstance.getServiceInstanceName());
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri));
boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance);
assertFalse(nameInUse);
}
use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.
the class AAIVfModuleResourcesTest method checkNameInUseTrueTest.
@Test
public void checkNameInUseTrueTest() throws Exception {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
assertTrue(nameInUse);
}
use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.
the class AAIVfModuleResourcesTest method checkNameInUseFalseTest.
@Test
public void checkNameInUseFalseTest() throws Exception {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUri));
boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
assertFalse(nameInUse);
}
use of org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri in project so by onap.
the class AAIVfModuleResourcesTest method checkNameInUseFalseIsResumeTest.
@Test
public void checkNameInUseFalseIsResumeTest() throws Exception {
AAIPluralResourceUri vfModuleUri = AAIUriFactory.createNodesUri(Types.VF_MODULES.getFragment()).queryParam("vf-module-name", vfModule.getVfModuleName());
AAIPluralResourceUri vfModuleUriWithCustomization = vfModuleUri.clone().queryParam("model-customization-id", vfModule.getModelInfoVfModule().getModelCustomizationUUID());
doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(vfModuleUriWithCustomization));
boolean nameInUse = aaiVfModuleResources.checkNameInUse(vfModule);
assertFalse(nameInUse);
}
Aggregations