@Test public void testConvertContainsExpectedMultipleKeyValuePairWhenItsTypesAreDifferentInTagsProperty() { String nameKey = "name"; String nameValue = "test"; String intKey = "number"; Integer intValue = 11; Blueprint source = createSource(); source.setTags(JSON_TO_STRING.convertToEntityAttribute(String.format("{\"%s\":\"%s\", \"%s\":%d}", nameKey, nameValue, intKey, intValue))); BlueprintV4Response result = underTest.convert(source); Assert.assertNotNull(result.getTags()); Assert.assertTrue(result.getTags().containsKey(nameKey)); Assert.assertTrue(result.getTags().containsKey(intKey)); Assert.assertNotNull(result.getTags().get(nameKey)); Assert.assertNotNull(result.getTags().get(intKey)); Assert.assertEquals(nameValue, result.getTags().get(nameKey)); Assert.assertEquals(intValue, result.getTags().get(intKey)); }
@Override public BlueprintV4Response convert(Blueprint entity) { BlueprintV4Response blueprintJson = new BlueprintV4Response(); blueprintJson.setName(entity.getName()); blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription()); blueprintJson.setHostGroupCount(entity.getHostGroupCount()); blueprintJson.setStatus(entity.getStatus()); blueprintJson.setTags(entity.getTags().getMap()); blueprintJson.setBlueprint(entity.getBlueprintText()); blueprintJson.setCrn(entity.getResourceCrn()); blueprintJson.setCreated(entity.getCreated()); return blueprintJson; }
BlueprintToBlueprintV4ResponseConverter extends AbstractConversionServiceAwareConverter<Blueprint, BlueprintV4Response> { @Override public BlueprintV4Response convert(Blueprint entity) { BlueprintV4Response blueprintJson = new BlueprintV4Response(); blueprintJson.setName(entity.getName()); blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription()); blueprintJson.setHostGroupCount(entity.getHostGroupCount()); blueprintJson.setStatus(entity.getStatus()); blueprintJson.setTags(entity.getTags().getMap()); blueprintJson.setBlueprint(entity.getBlueprintText()); blueprintJson.setCrn(entity.getResourceCrn()); blueprintJson.setCreated(entity.getCreated()); return blueprintJson; } }
BlueprintToBlueprintV4ResponseConverter extends AbstractConversionServiceAwareConverter<Blueprint, BlueprintV4Response> { @Override public BlueprintV4Response convert(Blueprint entity) { BlueprintV4Response blueprintJson = new BlueprintV4Response(); blueprintJson.setName(entity.getName()); blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription()); blueprintJson.setHostGroupCount(entity.getHostGroupCount()); blueprintJson.setStatus(entity.getStatus()); blueprintJson.setTags(entity.getTags().getMap()); blueprintJson.setBlueprint(entity.getBlueprintText()); blueprintJson.setCrn(entity.getResourceCrn()); blueprintJson.setCreated(entity.getCreated()); return blueprintJson; }  }
BlueprintToBlueprintV4ResponseConverter extends AbstractConversionServiceAwareConverter<Blueprint, BlueprintV4Response> { @Override public BlueprintV4Response convert(Blueprint entity) { BlueprintV4Response blueprintJson = new BlueprintV4Response(); blueprintJson.setName(entity.getName()); blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription()); blueprintJson.setHostGroupCount(entity.getHostGroupCount()); blueprintJson.setStatus(entity.getStatus()); blueprintJson.setTags(entity.getTags().getMap()); blueprintJson.setBlueprint(entity.getBlueprintText()); blueprintJson.setCrn(entity.getResourceCrn()); blueprintJson.setCreated(entity.getCreated()); return blueprintJson; }  @Override BlueprintV4Response convert(Blueprint entity); }
BlueprintToBlueprintV4ResponseConverter extends AbstractConversionServiceAwareConverter<Blueprint, BlueprintV4Response> { @Override public BlueprintV4Response convert(Blueprint entity) { BlueprintV4Response blueprintJson = new BlueprintV4Response(); blueprintJson.setName(entity.getName()); blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription()); blueprintJson.setHostGroupCount(entity.getHostGroupCount()); blueprintJson.setStatus(entity.getStatus()); blueprintJson.setTags(entity.getTags().getMap()); blueprintJson.setBlueprint(entity.getBlueprintText()); blueprintJson.setCrn(entity.getResourceCrn()); blueprintJson.setCreated(entity.getCreated()); return blueprintJson; }  @Override BlueprintV4Response convert(Blueprint entity);  }