use of org.alien4cloud.tosca.normative.primitives.Time in project alien4cloud by alien4cloud.
the class ToscaTypeConverterTest method convert_time_to_property_value.
@Test
public void convert_time_to_property_value() throws Exception {
PropertyDefinition propertyDefinition = new PropertyDefinition();
propertyDefinition.setType(ToscaTypes.TIME);
PropertyValue propertyValue = converter.toPropertyValue("2 d", propertyDefinition);
Object time = ToscaTypes.fromYamlTypeName(propertyDefinition.getType()).parse(propertyValue.getValue().toString());
assertThat(time).isInstanceOf(Time.class);
assertThat(time).isEqualTo(new Time(2, TimeUnit.D));
}
Aggregations