use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class VfModuleRestHandlerTest method test_find_vf_module_recipe_not_found.
@Test
public void test_find_vf_module_recipe_not_found() throws MalformedURLException, NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
exceptionRule.expect(NoRecipeException.class);
exceptionRule.expectMessage("Unable to locate custom or default recipe for ModelType: vfModule , Action: createInstance, CustomizationId: testModelId");
restHandler.findVfModuleRecipe("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
}
use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class VfModuleRestHandlerTest method test_find_vf_module_recipe.
@Test
public void test_find_vf_module_recipe() throws MalformedURLException, NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
doReturn(expected).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
Recipe actual = restHandler.findVfModuleRecipe("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
assertThat(actual, sameBeanAs(expected));
Mockito.verify(catalogDbClient, Mockito.times(1)).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
}
use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound.
@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndActionNotFound() {
VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(UUID.randomUUID().toString(), "volumeGroup", "createInstance");
assertNull(vnfComponentsRecipe);
}
use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction.
@Test
public void testGetFirstVnfComponentsRecipeByVnfComponentTypeAndAction() {
VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVnfComponentTypeAndAction("volumeGroup", "createInstance");
assertNotNull(vnfComponentsRecipe);
assertNotNull(vnfComponentsRecipe.getAction());
assertNotNull(vnfComponentsRecipe.getVnfComponentType());
assertEquals("VID_DEFAULT recipe t", vnfComponentsRecipe.getDescription());
assertEquals("/mso/async/services/CreateVfModuleVolumeInfraV1", vnfComponentsRecipe.getOrchestrationUri());
}
use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class CatalogDbClientTest method testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction.
@Test
public void testGetFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction() {
VnfComponentsRecipe vnfComponentsRecipe = client.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("20c4431c-246d-11e7-93ae-92361f002671", "volumeGroup", "createInstance");
assertNotNull(vnfComponentsRecipe);
assertNotNull(vnfComponentsRecipe.getAction());
assertNotNull(vnfComponentsRecipe.getVfModuleModelUUID());
assertNotNull(vnfComponentsRecipe.getVnfComponentType());
assertEquals("Gr api recipe to create volume-group", vnfComponentsRecipe.getDescription());
assertEquals("/mso/async/services/WorkflowActionBB", vnfComponentsRecipe.getOrchestrationUri());
}
Aggregations