use of org.openhab.core.config.core.dto.ConfigDescriptionParameterDTO in project openhab-core by openhab.
the class EnrichedConfigDescriptionDTOMapperTest method testThatDefaultValuesAreEmptyIfMultipleIsTrue.
@Test
public void testThatDefaultValuesAreEmptyIfMultipleIsTrue() {
ConfigDescriptionParameter configDescriptionParameter = ConfigDescriptionParameterBuilder.create(CONFIG_PARAMETER_NAME, Type.TEXT).withMultiple(true).build();
ConfigDescription configDescription = ConfigDescriptionBuilder.create(CONFIG_URI).withParameter(configDescriptionParameter).build();
ConfigDescriptionDTO cddto = EnrichedConfigDescriptionDTOMapper.map(configDescription);
assertThat(cddto.parameters, hasSize(1));
ConfigDescriptionParameterDTO cdpdto = cddto.parameters.get(0);
assertThat(cdpdto, instanceOf(EnrichedConfigDescriptionParameterDTO.class));
assertThat(cdpdto.defaultValue, is(nullValue()));
EnrichedConfigDescriptionParameterDTO ecdpdto = (EnrichedConfigDescriptionParameterDTO) cdpdto;
assertThat(ecdpdto.defaultValues, is(nullValue()));
}
Aggregations