@Test void convert() { BlueprintV4Request request = new BlueprintV4Request(); request.setBlueprint("blueprint"); request.setName("name"); request.setDescription("desc"); request.setTags(Map.of("k1", "v1", "k2", "v2")); CreateClusterTemplateRequest result = underTest.convert(request); assertEquals(request.getBlueprint(), result.getClusterTemplateContent()); assertEquals(request.getName(), result.getClusterTemplateName()); assertEquals(request.getDescription(), result.getDescription()); List<DatahubResourceTagRequest> resultTags = result.getTags(); request.getTags().forEach((key, value) -> { Optional<DatahubResourceTagRequest> first = resultTags.stream().filter(t -> key.equals(t.getKey())).findFirst(); assertTrue(first.isPresent()); assertEquals(value, first.get().getValue()); }); }
@Override public CreateClusterTemplateRequest convert(BlueprintV4Request source) { CreateClusterTemplateRequest createClusterTemplateRequest = new CreateClusterTemplateRequest(); createClusterTemplateRequest.setClusterTemplateName(source.getName()); createClusterTemplateRequest.setDescription(source.getDescription()); createClusterTemplateRequest.setClusterTemplateContent(source.getBlueprint()); createClusterTemplateRequest.setTags(convertTags(source)); return createClusterTemplateRequest; }
BlueprintV4RequestToCreateClusterTemplateRequestConverter extends AbstractConversionServiceAwareConverter<BlueprintV4Request, CreateClusterTemplateRequest> { @Override public CreateClusterTemplateRequest convert(BlueprintV4Request source) { CreateClusterTemplateRequest createClusterTemplateRequest = new CreateClusterTemplateRequest(); createClusterTemplateRequest.setClusterTemplateName(source.getName()); createClusterTemplateRequest.setDescription(source.getDescription()); createClusterTemplateRequest.setClusterTemplateContent(source.getBlueprint()); createClusterTemplateRequest.setTags(convertTags(source)); return createClusterTemplateRequest; } }
BlueprintV4RequestToCreateClusterTemplateRequestConverter extends AbstractConversionServiceAwareConverter<BlueprintV4Request, CreateClusterTemplateRequest> { @Override public CreateClusterTemplateRequest convert(BlueprintV4Request source) { CreateClusterTemplateRequest createClusterTemplateRequest = new CreateClusterTemplateRequest(); createClusterTemplateRequest.setClusterTemplateName(source.getName()); createClusterTemplateRequest.setDescription(source.getDescription()); createClusterTemplateRequest.setClusterTemplateContent(source.getBlueprint()); createClusterTemplateRequest.setTags(convertTags(source)); return createClusterTemplateRequest; }  }
BlueprintV4RequestToCreateClusterTemplateRequestConverter extends AbstractConversionServiceAwareConverter<BlueprintV4Request, CreateClusterTemplateRequest> { @Override public CreateClusterTemplateRequest convert(BlueprintV4Request source) { CreateClusterTemplateRequest createClusterTemplateRequest = new CreateClusterTemplateRequest(); createClusterTemplateRequest.setClusterTemplateName(source.getName()); createClusterTemplateRequest.setDescription(source.getDescription()); createClusterTemplateRequest.setClusterTemplateContent(source.getBlueprint()); createClusterTemplateRequest.setTags(convertTags(source)); return createClusterTemplateRequest; }  @Override CreateClusterTemplateRequest convert(BlueprintV4Request source); }
BlueprintV4RequestToCreateClusterTemplateRequestConverter extends AbstractConversionServiceAwareConverter<BlueprintV4Request, CreateClusterTemplateRequest> { @Override public CreateClusterTemplateRequest convert(BlueprintV4Request source) { CreateClusterTemplateRequest createClusterTemplateRequest = new CreateClusterTemplateRequest(); createClusterTemplateRequest.setClusterTemplateName(source.getName()); createClusterTemplateRequest.setDescription(source.getDescription()); createClusterTemplateRequest.setClusterTemplateContent(source.getBlueprint()); createClusterTemplateRequest.setTags(convertTags(source)); return createClusterTemplateRequest; }  @Override CreateClusterTemplateRequest convert(BlueprintV4Request source);  }