Search in sources :

Example 1 with ThingTypeProvider

use of org.eclipse.smarthome.core.thing.binding.ThingTypeProvider in project smarthome by eclipse.

the class ThingManagerOSGiJavaTest method registerThingTypeProvider.

private void registerThingTypeProvider() throws Exception {
    ThingType thingType = ThingTypeBuilder.instance(THING_TYPE_UID, "label").withConfigDescriptionURI(CONFIG_DESCRIPTION_THING).withChannelDefinitions(Collections.singletonList(new ChannelDefinition("channel", CHANNEL_TYPE_UID))).build();
    ThingTypeProvider mockThingTypeProvider = mock(ThingTypeProvider.class);
    when(mockThingTypeProvider.getThingType(eq(THING_TYPE_UID), any())).thenReturn(thingType);
    registerService(mockThingTypeProvider);
}
Also used : ChannelDefinition(org.eclipse.smarthome.core.thing.type.ChannelDefinition) ThingType(org.eclipse.smarthome.core.thing.type.ThingType) ThingTypeProvider(org.eclipse.smarthome.core.thing.binding.ThingTypeProvider)

Aggregations

ThingTypeProvider (org.eclipse.smarthome.core.thing.binding.ThingTypeProvider)1 ChannelDefinition (org.eclipse.smarthome.core.thing.type.ChannelDefinition)1 ThingType (org.eclipse.smarthome.core.thing.type.ThingType)1