@Test void convert() { StackV4Request request = getStackV4Request(); CreateAWSClusterRequest result = underTest.convert(request); assertEquals(request.getName(), result.getClusterName()); assertEquals(request.getCluster().getBlueprintName(), result.getClusterTemplateName()); assertEquals(ENV_NAME, result.getEnvironmentName()); assertEquals(request.getImage().getCatalog(), result.getImage().getCatalogName()); assertEquals(request.getImage().getId(), result.getImage().getId()); assertEquals(request.getNetwork().getAws().getSubnetId(), result.getSubnetId()); assertEquals(request.getTags().getUserDefined().size(), result.getTags().size()); request.getTags().getUserDefined().forEach((key, value) -> assertTrue(result.getTags().stream().anyMatch(tr -> key.equals(tr.getKey()) && value.equals(tr.getValue())))); assertInstanceGroups(request.getInstanceGroups(), result.getInstanceGroups()); }
@Override public CreateAWSClusterRequest convert(StackV4Request source) { CreateAWSClusterRequest request = new CreateAWSClusterRequest(); request.setClusterName(source.getName()); request.setClusterTemplateName(source.getCluster().getBlueprintName()); request.setEnvironmentName(getEnvironmentName(source.getEnvironmentCrn())); request.setImage(convertImageRequest(source.getImage())); request.setInstanceGroups(convertInstanceGroups(source.getInstanceGroups())); request.setSubnetId(source.getNetwork().getAws().getSubnetId()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); return request; }
StackRequestToCreateAWSClusterRequestConverter implements StackRequestToCliRequestConverter { @Override public CreateAWSClusterRequest convert(StackV4Request source) { CreateAWSClusterRequest request = new CreateAWSClusterRequest(); request.setClusterName(source.getName()); request.setClusterTemplateName(source.getCluster().getBlueprintName()); request.setEnvironmentName(getEnvironmentName(source.getEnvironmentCrn())); request.setImage(convertImageRequest(source.getImage())); request.setInstanceGroups(convertInstanceGroups(source.getInstanceGroups())); request.setSubnetId(source.getNetwork().getAws().getSubnetId()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); return request; } }
StackRequestToCreateAWSClusterRequestConverter implements StackRequestToCliRequestConverter { @Override public CreateAWSClusterRequest convert(StackV4Request source) { CreateAWSClusterRequest request = new CreateAWSClusterRequest(); request.setClusterName(source.getName()); request.setClusterTemplateName(source.getCluster().getBlueprintName()); request.setEnvironmentName(getEnvironmentName(source.getEnvironmentCrn())); request.setImage(convertImageRequest(source.getImage())); request.setInstanceGroups(convertInstanceGroups(source.getInstanceGroups())); request.setSubnetId(source.getNetwork().getAws().getSubnetId()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); return request; }  }
StackRequestToCreateAWSClusterRequestConverter implements StackRequestToCliRequestConverter { @Override public CreateAWSClusterRequest convert(StackV4Request source) { CreateAWSClusterRequest request = new CreateAWSClusterRequest(); request.setClusterName(source.getName()); request.setClusterTemplateName(source.getCluster().getBlueprintName()); request.setEnvironmentName(getEnvironmentName(source.getEnvironmentCrn())); request.setImage(convertImageRequest(source.getImage())); request.setInstanceGroups(convertInstanceGroups(source.getInstanceGroups())); request.setSubnetId(source.getNetwork().getAws().getSubnetId()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); return request; }  @Override CloudPlatform supportedPlatform(); @Override CreateAWSClusterRequest convert(StackV4Request source); }
StackRequestToCreateAWSClusterRequestConverter implements StackRequestToCliRequestConverter { @Override public CreateAWSClusterRequest convert(StackV4Request source) { CreateAWSClusterRequest request = new CreateAWSClusterRequest(); request.setClusterName(source.getName()); request.setClusterTemplateName(source.getCluster().getBlueprintName()); request.setEnvironmentName(getEnvironmentName(source.getEnvironmentCrn())); request.setImage(convertImageRequest(source.getImage())); request.setInstanceGroups(convertInstanceGroups(source.getInstanceGroups())); request.setSubnetId(source.getNetwork().getAws().getSubnetId()); request.setTags(getIfNotNull(source.getTags(), this::getTags)); return request; }  @Override CloudPlatform supportedPlatform(); @Override CreateAWSClusterRequest convert(StackV4Request source);  }