use of com.sequenceiq.cloudbreak.api.endpoint.v4.recipes.responses.RecipeV4Response in project cloudbreak by hortonworks.
the class RecipeToRecipeV4ResponseConverterTest method testConvert.
@Test
public void testConvert() {
// GIVEN
// WHEN
Recipe recipe = getSource();
when(workspaceToWorkspaceResourceV4ResponseConverter.convert(recipe.getWorkspace())).thenReturn(new WorkspaceResourceV4Response());
RecipeV4Response result = underTest.convert(recipe);
// THEN
assertAllFieldsNotNull(result, List.of("created"));
}
use of com.sequenceiq.cloudbreak.api.endpoint.v4.recipes.responses.RecipeV4Response in project cloudbreak by hortonworks.
the class RecipeToRecipeV4ResponseConverter method convert.
public RecipeV4Response convert(Recipe recipe) {
RecipeV4Response json = new RecipeV4Response();
json.setName(recipe.getName());
json.setDescription(recipe.getDescription());
json.setType(RecipeV4Type.valueOf(recipe.getRecipeType().name()));
json.setContent(recipe.getContent());
WorkspaceResourceV4Response workspace = workspaceToWorkspaceResourceV4ResponseConverter.convert(recipe.getWorkspace());
json.setWorkspace(workspace);
json.setCreator(recipe.getCreator());
json.setCrn(recipe.getResourceCrn());
json.setCreated(recipe.getCreated());
return json;
}
Aggregations