Search in sources :

Example 6 with ConfigDescriptionParameterDTO

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()));
}
Also used : ConfigDescriptionParameterDTO(org.openhab.core.config.core.dto.ConfigDescriptionParameterDTO) ConfigDescriptionDTO(org.openhab.core.config.core.dto.ConfigDescriptionDTO) ConfigDescription(org.openhab.core.config.core.ConfigDescription) ConfigDescriptionParameter(org.openhab.core.config.core.ConfigDescriptionParameter) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigDescriptionParameterDTO (org.openhab.core.config.core.dto.ConfigDescriptionParameterDTO)6 ConfigDescription (org.openhab.core.config.core.ConfigDescription)5 ConfigDescriptionDTO (org.openhab.core.config.core.dto.ConfigDescriptionDTO)5 ConfigDescriptionParameter (org.openhab.core.config.core.ConfigDescriptionParameter)4 Test (org.junit.jupiter.api.Test)3 URI (java.net.URI)2 ConfigDescriptionParameterGroupDTO (org.openhab.core.config.core.dto.ConfigDescriptionParameterGroupDTO)2 ArrayList (java.util.ArrayList)1 ChannelDefinitionDTO (org.openhab.core.thing.dto.ChannelDefinitionDTO)1 ChannelTypeDTO (org.openhab.core.thing.dto.ChannelTypeDTO)1 StrippedThingTypeDTO (org.openhab.core.thing.dto.StrippedThingTypeDTO)1 ThingTypeDTO (org.openhab.core.thing.dto.ThingTypeDTO)1 BridgeType (org.openhab.core.thing.type.BridgeType)1