use of org.onap.so.db.catalog.beans.VnfComponentsRecipe in project so by onap.
the class VfModuleRestHandlerTest method test_find_vf_module_recipe_default_recipe.
@Test
public void test_find_vf_module_recipe_default_recipe() throws MalformedURLException, NoRecipeException {
VnfComponentsRecipe expected = new VnfComponentsRecipe();
expected.setAction("createInstance");
doReturn(null).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("testModelId", ModelType.vfModule.toString(), Action.createInstance.toString());
doReturn(expected).when(catalogDbClient).getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction("GR-API-DEFAULT", 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());
}
Aggregations