@Test public void testConvert() { Recipe recipe = getSource(); when(conversionService.convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class)).thenReturn(new WorkspaceResourceV4Response()); RecipeV4Response result = underTest.convert(recipe); assertAllFieldsNotNull(result, List.of("created")); }
@Override 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 = getConversionService().convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class); json.setWorkspace(workspace); json.setCreator(recipe.getCreator()); json.setCrn(recipe.getResourceCrn()); json.setCreated(recipe.getCreated()); return json; }
RecipeToRecipeV4ResponseConverter extends AbstractConversionServiceAwareConverter<Recipe, RecipeV4Response> { @Override 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 = getConversionService().convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class); json.setWorkspace(workspace); json.setCreator(recipe.getCreator()); json.setCrn(recipe.getResourceCrn()); json.setCreated(recipe.getCreated()); return json; } }
RecipeToRecipeV4ResponseConverter extends AbstractConversionServiceAwareConverter<Recipe, RecipeV4Response> { @Override 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 = getConversionService().convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class); json.setWorkspace(workspace); json.setCreator(recipe.getCreator()); json.setCrn(recipe.getResourceCrn()); json.setCreated(recipe.getCreated()); return json; }  }
RecipeToRecipeV4ResponseConverter extends AbstractConversionServiceAwareConverter<Recipe, RecipeV4Response> { @Override 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 = getConversionService().convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class); json.setWorkspace(workspace); json.setCreator(recipe.getCreator()); json.setCrn(recipe.getResourceCrn()); json.setCreated(recipe.getCreated()); return json; }  @Override RecipeV4Response convert(Recipe recipe); }
RecipeToRecipeV4ResponseConverter extends AbstractConversionServiceAwareConverter<Recipe, RecipeV4Response> { @Override 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 = getConversionService().convert(recipe.getWorkspace(), WorkspaceResourceV4Response.class); json.setWorkspace(workspace); json.setCreator(recipe.getCreator()); json.setCrn(recipe.getResourceCrn()); json.setCreated(recipe.getCreated()); return json; }  @Override RecipeV4Response convert(Recipe recipe);  }