use of org.eclipse.smarthome.binding.dmx.handler.ArtnetBridgeHandler in project smarthome by eclipse.
the class ArtnetBridgeHandlerTest method setUp.
@Before
public void setUp() {
bridgeProperties = new HashMap<>();
bridgeProperties.put(CONFIG_ADDRESS, TEST_ADDRESS);
bridgeProperties.put(CONFIG_UNIVERSE, TEST_UNIVERSE);
bridge = BridgeBuilder.create(THING_TYPE_ARTNET_BRIDGE, "artnetbridge").withLabel("Artnet 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 ArtnetBridgeHandler(bridge) {
@Override
protected void validateConfigurationParameters(Map<String, Object> configurationParameters) {
}
};
bridgeHandler.getThing().setHandler(bridgeHandler);
bridgeHandler.setCallback(mockCallback);
bridgeHandler.initialize();
}
Aggregations