use of com.sequenceiq.cloudbreak.api.model.BlueprintResponse in project cloudbreak by hortonworks.
the class BlueprintToBlueprintResponseConverter method convert.
@Override
public BlueprintResponse convert(Blueprint entity) {
BlueprintResponse blueprintJson = new BlueprintResponse();
blueprintJson.setId(entity.getId());
blueprintJson.setName(entity.getName());
blueprintJson.setPublicInAccount(entity.isPublicInAccount());
blueprintJson.setDescription(entity.getDescription() == null ? "" : entity.getDescription());
blueprintJson.setHostGroupCount(entity.getHostGroupCount());
blueprintJson.setStatus(entity.getStatus());
try {
blueprintJson.setInputs(convertInputParameters(entity.getInputParameters()));
} catch (IOException e) {
LOGGER.error(String.format("Blueprint's (%s, id:%s) input parameters could not be converted to JSON.", entity.getName(), entity.getId()), e);
}
blueprintJson.setAmbariBlueprint(entity.getBlueprintText());
return blueprintJson;
}
use of com.sequenceiq.cloudbreak.api.model.BlueprintResponse in project cloudbreak by hortonworks.
the class BlueprintToBlueprintResponseConverterTest method testConvert.
@Test
public void testConvert() {
// GIVEN
given(jsonHelper.createJsonFromString(anyString())).willReturn(jsonNode);
given(jsonNode.toString()).willReturn("dummyAmbariBlueprint");
// WHEN
BlueprintResponse result = underTest.convert(getSource());
// THEN
assertAllFieldsNotNull(result);
}
Aggregations