Search in sources :

Example 1 with SacnBridgeHandler

use of org.eclipse.smarthome.binding.dmx.handler.SacnBridgeHandler in project smarthome by eclipse.

the class SacnBridgeHandlerTest method setUp.

@Before
public void setUp() {
    bridgeProperties = new HashMap<>();
    bridgeProperties.put(CONFIG_ADDRESS, TEST_ADDRESS);
    bridgeProperties.put(CONFIG_UNIVERSE, TEST_UNIVERSE);
    bridgeProperties.put(CONFIG_SACN_MODE, "unicast");
    bridge = BridgeBuilder.create(THING_TYPE_SACN_BRIDGE, "sacnbridge").withLabel("sACN Bridge").withChannel(ChannelBuilder.create(CHANNEL_UID_MUTE, "Switch").withType(MUTE_CHANNEL_TYPEUID).build()).withConfiguration(new Configuration(bridgeProperties)).build();
    ThingHandlerCallback mockCallback = mock(ThingHandlerCallback.class);
    doAnswer(answer -> {
        ((Thing) answer.getArgument(0)).setStatusInfo(answer.getArgument(1));
        return null;
    }).when(mockCallback).statusUpdated(any(), any());
    bridgeHandler = new SacnBridgeHandler(bridge) {

        @Override
        protected void validateConfigurationParameters(Map<String, Object> configurationParameters) {
        }
    };
    bridgeHandler.getThing().setHandler(bridgeHandler);
    bridgeHandler.setCallback(mockCallback);
    bridgeHandler.initialize();
}
Also used : Configuration(org.eclipse.smarthome.config.core.Configuration) ThingHandlerCallback(org.eclipse.smarthome.core.thing.binding.ThingHandlerCallback) SacnBridgeHandler(org.eclipse.smarthome.binding.dmx.handler.SacnBridgeHandler) Thing(org.eclipse.smarthome.core.thing.Thing) Before(org.junit.Before)

Aggregations

SacnBridgeHandler (org.eclipse.smarthome.binding.dmx.handler.SacnBridgeHandler)1 Configuration (org.eclipse.smarthome.config.core.Configuration)1 Thing (org.eclipse.smarthome.core.thing.Thing)1 ThingHandlerCallback (org.eclipse.smarthome.core.thing.binding.ThingHandlerCallback)1 Before (org.junit.Before)1