]> git.basschouten.com Git - openhab-addons.git/blob
0b44c5a137c53a05f6a0b997728ffff14acdd9fa
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.mielecloud.internal.handler;
14
15 import static org.junit.jupiter.api.Assertions.*;
16 import static org.mockito.ArgumentMatchers.*;
17 import static org.mockito.Mockito.*;
18 import static org.openhab.binding.mielecloud.internal.MieleCloudBindingConstants.Channels.*;
19 import static org.openhab.binding.mielecloud.internal.util.MieleCloudBindingIntegrationTestConstants.*;
20 import static org.openhab.binding.mielecloud.internal.util.ReflectionUtil.setPrivate;
21
22 import java.util.ArrayList;
23 import java.util.Collections;
24 import java.util.List;
25 import java.util.Objects;
26 import java.util.Optional;
27
28 import org.eclipse.jdt.annotation.NonNullByDefault;
29 import org.eclipse.jdt.annotation.Nullable;
30 import org.junit.jupiter.api.BeforeEach;
31 import org.junit.jupiter.api.Test;
32 import org.openhab.binding.mielecloud.internal.MieleCloudBindingConstants;
33 import org.openhab.binding.mielecloud.internal.auth.OAuthTokenRefresher;
34 import org.openhab.binding.mielecloud.internal.auth.OpenHabOAuthTokenRefresher;
35 import org.openhab.binding.mielecloud.internal.util.MieleCloudBindingIntegrationTestConstants;
36 import org.openhab.binding.mielecloud.internal.webservice.MieleWebservice;
37 import org.openhab.binding.mielecloud.internal.webservice.MieleWebserviceFactory;
38 import org.openhab.binding.mielecloud.internal.webservice.api.DeviceState;
39 import org.openhab.binding.mielecloud.internal.webservice.api.ProgramStatus;
40 import org.openhab.binding.mielecloud.internal.webservice.api.json.DeviceType;
41 import org.openhab.binding.mielecloud.internal.webservice.api.json.ProcessAction;
42 import org.openhab.binding.mielecloud.internal.webservice.api.json.StateType;
43 import org.openhab.binding.mielecloud.internal.webservice.exception.MieleWebserviceException;
44 import org.openhab.core.auth.client.oauth2.AccessTokenResponse;
45 import org.openhab.core.auth.client.oauth2.OAuthClientService;
46 import org.openhab.core.auth.client.oauth2.OAuthFactory;
47 import org.openhab.core.config.core.Configuration;
48 import org.openhab.core.items.Item;
49 import org.openhab.core.items.ItemBuilder;
50 import org.openhab.core.items.ItemBuilderFactory;
51 import org.openhab.core.items.ItemRegistry;
52 import org.openhab.core.library.types.DecimalType;
53 import org.openhab.core.library.types.OnOffType;
54 import org.openhab.core.library.types.StringType;
55 import org.openhab.core.test.java.JavaOSGiTest;
56 import org.openhab.core.thing.Bridge;
57 import org.openhab.core.thing.Channel;
58 import org.openhab.core.thing.ChannelUID;
59 import org.openhab.core.thing.Thing;
60 import org.openhab.core.thing.ThingRegistry;
61 import org.openhab.core.thing.ThingStatus;
62 import org.openhab.core.thing.ThingStatusDetail;
63 import org.openhab.core.thing.ThingTypeUID;
64 import org.openhab.core.thing.ThingUID;
65 import org.openhab.core.thing.binding.ThingHandler;
66 import org.openhab.core.thing.binding.ThingHandlerFactory;
67 import org.openhab.core.thing.binding.builder.BridgeBuilder;
68 import org.openhab.core.thing.binding.builder.ChannelBuilder;
69 import org.openhab.core.thing.binding.builder.ThingBuilder;
70 import org.openhab.core.thing.link.ItemChannelLink;
71 import org.openhab.core.thing.link.ItemChannelLinkRegistry;
72 import org.openhab.core.thing.type.ChannelDefinition;
73 import org.openhab.core.thing.type.ChannelType;
74 import org.openhab.core.thing.type.ChannelTypeRegistry;
75 import org.openhab.core.thing.type.ChannelTypeUID;
76 import org.openhab.core.thing.type.ThingType;
77 import org.openhab.core.thing.type.ThingTypeRegistry;
78 import org.openhab.core.types.State;
79 import org.openhab.core.types.UnDefType;
80
81 /**
82  * @author Björn Lange - Initial contribution
83  */
84 @NonNullByDefault
85 public abstract class AbstractMieleThingHandlerTest extends JavaOSGiTest {
86     protected static final State NULL_VALUE_STATE = UnDefType.UNDEF;
87
88     @Nullable
89     private Bridge bridge;
90     @Nullable
91     private MieleBridgeHandler bridgeHandler;
92     @Nullable
93     private ThingRegistry thingRegistry;
94     @Nullable
95     private MieleWebservice webserviceMock;
96     @Nullable
97     private AbstractMieleThingHandler thingHandler;
98
99     @Nullable
100     private ItemRegistry itemRegistry;
101
102     protected Bridge getBridge() {
103         assertNotNull(bridge);
104         return Objects.requireNonNull(bridge);
105     }
106
107     protected MieleBridgeHandler getBridgeHandler() {
108         assertNotNull(bridgeHandler);
109         return Objects.requireNonNull(bridgeHandler);
110     }
111
112     protected ThingRegistry getThingRegistry() {
113         assertNotNull(thingRegistry);
114         return Objects.requireNonNull(thingRegistry);
115     }
116
117     protected MieleWebservice getWebserviceMock() {
118         assertNotNull(webserviceMock);
119         return Objects.requireNonNull(webserviceMock);
120     }
121
122     protected AbstractMieleThingHandler getThingHandler() {
123         assertNotNull(thingHandler);
124         return Objects.requireNonNull(thingHandler);
125     }
126
127     protected ItemRegistry getItemRegistry() {
128         assertNotNull(itemRegistry);
129         return Objects.requireNonNull(itemRegistry);
130     }
131
132     private void setUpThingRegistry() {
133         thingRegistry = getService(ThingRegistry.class, ThingRegistry.class);
134         assertNotNull(thingRegistry, "Thing registry is missing");
135     }
136
137     private void setUpItemRegistry() {
138         itemRegistry = getService(ItemRegistry.class, ItemRegistry.class);
139         assertNotNull(itemRegistry);
140     }
141
142     private void setUpWebservice()
143             throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
144         webserviceMock = mock(MieleWebservice.class);
145         when(getWebserviceMock().hasAccessToken()).thenReturn(true);
146
147         MieleWebserviceFactory webserviceFactory = mock(MieleWebserviceFactory.class);
148         when(webserviceFactory.create(any())).thenReturn(getWebserviceMock());
149
150         MieleHandlerFactory factory = getService(ThingHandlerFactory.class, MieleHandlerFactory.class);
151         assertNotNull(factory);
152         setPrivate(Objects.requireNonNull(factory), "webserviceFactory", webserviceFactory);
153     }
154
155     private void setUpBridge() throws Exception {
156         AccessTokenResponse accessTokenResponse = new AccessTokenResponse();
157         accessTokenResponse.setAccessToken(ACCESS_TOKEN);
158
159         OAuthClientService oAuthClientService = mock(OAuthClientService.class);
160         when(oAuthClientService.getAccessTokenResponse()).thenReturn(accessTokenResponse);
161
162         OAuthFactory oAuthFactory = mock(OAuthFactory.class);
163         when(oAuthFactory
164                 .getOAuthClientService(MieleCloudBindingIntegrationTestConstants.BRIDGE_THING_UID.getAsString()))
165                         .thenReturn(oAuthClientService);
166
167         OpenHabOAuthTokenRefresher tokenRefresher = getService(OAuthTokenRefresher.class,
168                 OpenHabOAuthTokenRefresher.class);
169         assertNotNull(tokenRefresher);
170         setPrivate(Objects.requireNonNull(tokenRefresher), "oauthFactory", oAuthFactory);
171
172         bridge = BridgeBuilder
173                 .create(MieleCloudBindingConstants.THING_TYPE_BRIDGE,
174                         MieleCloudBindingIntegrationTestConstants.BRIDGE_THING_UID)
175                 .withLabel("Miele@home Account")
176                 .withConfiguration(
177                         new Configuration(Collections.singletonMap(MieleCloudBindingConstants.CONFIG_PARAM_EMAIL,
178                                 MieleCloudBindingIntegrationTestConstants.EMAIL)))
179                 .build();
180         assertNotNull(bridge);
181
182         getThingRegistry().add(getBridge());
183
184         // then:
185         waitForAssert(() -> {
186             assertNotNull(getBridge().getHandler());
187             assertTrue(getBridge().getHandler() instanceof MieleBridgeHandler, "Handler type is wrong");
188         });
189
190         MieleBridgeHandler bridgeHandler = (MieleBridgeHandler) getBridge().getHandler();
191         assertNotNull(bridgeHandler);
192
193         waitForAssert(() -> {
194             assertNotNull(bridgeHandler.getThing());
195         });
196
197         bridgeHandler.initialize();
198         bridgeHandler.onConnectionAlive();
199         setPrivate(bridgeHandler, "discoveryService", null);
200         this.bridgeHandler = bridgeHandler;
201     }
202
203     protected AbstractMieleThingHandler createThingHandler(ThingTypeUID thingTypeUid, ThingUID thingUid,
204             Class<? extends AbstractMieleThingHandler> expectedHandlerClass, String deviceIdentifier) {
205         ThingRegistry registry = getThingRegistry();
206
207         List<Channel> channels = createChannelsForThingHandler(thingTypeUid, thingUid);
208
209         Thing thing = ThingBuilder.create(thingTypeUid, thingUid)
210                 .withConfiguration(new Configuration(Collections
211                         .singletonMap(MieleCloudBindingConstants.CONFIG_PARAM_DEVICE_IDENTIFIER, deviceIdentifier)))
212                 .withBridge(getBridge().getUID()).withChannels(channels).withLabel("DA-6996").build();
213         assertNotNull(thing);
214
215         registry.add(thing);
216
217         waitForAssert(() -> {
218             ThingHandler handler = thing.getHandler();
219             assertNotNull(handler);
220             assertTrue(expectedHandlerClass.isAssignableFrom(handler.getClass()), "Handler type is wrong");
221         });
222
223         createItemsForChannels(thing);
224         linkChannelsToItems(thing);
225
226         ThingHandler handler = thing.getHandler();
227         assertNotNull(handler);
228         return (AbstractMieleThingHandler) Objects.requireNonNull(handler);
229     }
230
231     private List<Channel> createChannelsForThingHandler(ThingTypeUID thingTypeUid, ThingUID thingUid) {
232         ChannelTypeRegistry channelTypeRegistry = getService(ChannelTypeRegistry.class, ChannelTypeRegistry.class);
233         assertNotNull(channelTypeRegistry);
234
235         ThingTypeRegistry thingTypeRegistry = getService(ThingTypeRegistry.class, ThingTypeRegistry.class);
236         assertNotNull(thingTypeRegistry);
237
238         ThingType thingType = thingTypeRegistry.getThingType(thingTypeUid);
239         assertNotNull(thingType);
240
241         List<ChannelDefinition> channelDefinitions = thingType.getChannelDefinitions();
242         assertNotNull(channelDefinitions);
243
244         List<Channel> channels = new ArrayList<Channel>();
245         for (ChannelDefinition channelDefinition : channelDefinitions) {
246             ChannelTypeUID channelTypeUid = channelDefinition.getChannelTypeUID();
247             assertNotNull(channelTypeUid);
248
249             ChannelType channelType = channelTypeRegistry.getChannelType(channelTypeUid);
250             assertNotNull(channelType);
251
252             String acceptedItemType = channelType.getItemType();
253             assertNotNull(acceptedItemType);
254
255             String channelId = channelDefinition.getId();
256             assertNotNull(channelId);
257
258             ChannelUID channelUid = new ChannelUID(thingUid, channelId);
259             assertNotNull(channelUid);
260
261             Channel channel = ChannelBuilder.create(channelUid, acceptedItemType).build();
262             assertNotNull(channel);
263
264             channels.add(channel);
265         }
266
267         return channels;
268     }
269
270     private void createItemsForChannels(Thing thing) {
271         ItemBuilderFactory itemBuilderFactory = getService(ItemBuilderFactory.class);
272         assertNotNull(itemBuilderFactory);
273
274         for (Channel channel : thing.getChannels()) {
275             String acceptedItemType = channel.getAcceptedItemType();
276             assertNotNull(acceptedItemType);
277
278             ItemBuilder itemBuilder = itemBuilderFactory.newItemBuilder(Objects.requireNonNull(acceptedItemType),
279                     channel.getUID().getId());
280             assertNotNull(itemBuilder);
281
282             Item item = itemBuilder.build();
283             assertNotNull(item);
284
285             getItemRegistry().add(item);
286         }
287     }
288
289     private void linkChannelsToItems(Thing thing) {
290         ItemChannelLinkRegistry itemChannelLinkRegistry = getService(ItemChannelLinkRegistry.class,
291                 ItemChannelLinkRegistry.class);
292         assertNotNull(itemChannelLinkRegistry);
293
294         for (Channel channel : thing.getChannels()) {
295             String itemName = channel.getUID().getId();
296             assertNotNull(itemName);
297
298             ChannelUID channelUid = channel.getUID();
299             assertNotNull(channelUid);
300
301             ItemChannelLink link = itemChannelLinkRegistry.add(new ItemChannelLink(itemName, channelUid));
302             assertNotNull(link);
303         }
304     }
305
306     protected ChannelUID channel(String id) {
307         return new ChannelUID(getThingHandler().getThing().getUID(), id);
308     }
309
310     @BeforeEach
311     public void setUpAbstractMieleThingHandlerTest() throws Exception {
312         registerVolatileStorageService();
313         setUpThingRegistry();
314         setUpItemRegistry();
315         setUpWebservice();
316         setUpBridge();
317         thingHandler = setUpThingHandler();
318     }
319
320     private void assertThingStatusIs(Thing thing, ThingStatus expectedStatus, ThingStatusDetail expectedStatusDetail) {
321         assertThingStatusIs(thing, expectedStatus, expectedStatusDetail, null);
322     }
323
324     private void assertThingStatusIs(Thing thing, ThingStatus expectedStatus, ThingStatusDetail expectedStatusDetail,
325             @Nullable String expectedDescription) {
326         assertEquals(expectedStatus, thing.getStatus());
327         assertEquals(expectedStatusDetail, thing.getStatusInfo().getStatusDetail());
328         if (expectedDescription == null) {
329             assertNull(thing.getStatusInfo().getDescription());
330         } else {
331             assertEquals(expectedDescription, thing.getStatusInfo().getDescription());
332         }
333     }
334
335     protected State getChannelState(String channelUid) {
336         Item item = getItemRegistry().get(channelUid);
337         assertNotNull(item, "Item for channel UID " + channelUid + " is null.");
338         return item.getState();
339     }
340
341     /**
342      * Sets up the {@link ThingHandler} under test.
343      *
344      * @return The created {@link ThingHandler}.
345      */
346     protected abstract AbstractMieleThingHandler setUpThingHandler();
347
348     @Test
349     public void testCachedStateIsQueriedOnInitialize() throws Exception {
350         // then:
351         verify(getWebserviceMock()).dispatchDeviceState(SERIAL_NUMBER);
352     }
353
354     @Test
355     public void testThingStatusIsOfflineWithDetailGoneAndDetailMessageWhenDeviceIsRemoved() {
356         // when:
357         getBridgeHandler().onDeviceRemoved(SERIAL_NUMBER);
358
359         // then:
360         Thing thing = getThingHandler().getThing();
361         assertThingStatusIs(thing, ThingStatus.OFFLINE, ThingStatusDetail.GONE,
362                 "@text/mielecloud.thing.status.removed");
363     }
364
365     private DeviceState createDeviceStateMock(StateType stateType, String localizedState) {
366         DeviceState deviceState = mock(DeviceState.class);
367         when(deviceState.getDeviceIdentifier()).thenReturn(getThingHandler().getThing().getUID().getId());
368         when(deviceState.getRawType()).thenReturn(DeviceType.UNKNOWN);
369         when(deviceState.getStateType()).thenReturn(Optional.of(stateType));
370         when(deviceState.isInState(any())).thenCallRealMethod();
371         when(deviceState.getStatus()).thenReturn(Optional.of(localizedState));
372         return deviceState;
373     }
374
375     @Test
376     public void testStatusIsSetToOnlineWhenDeviceStateIsValid() {
377         // given:
378         DeviceState deviceState = createDeviceStateMock(StateType.ON, "On");
379
380         // when:
381         getBridgeHandler().onDeviceStateUpdated(deviceState);
382
383         // then:
384         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.ONLINE, ThingStatusDetail.NONE);
385     }
386
387     @Test
388     public void testStatusIsSetToOfflineWhenDeviceIsNotConnected() {
389         // given:
390         DeviceState deviceState = createDeviceStateMock(StateType.NOT_CONNECTED, "Not connected");
391
392         // when:
393         getBridgeHandler().onDeviceStateUpdated(deviceState);
394
395         // then:
396         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
397                 "@text/mielecloud.thing.status.disconnected");
398     }
399
400     @Test
401     public void testFailingPutProcessActionDoesNotSetTheDeviceToOffline() {
402         // given:
403         DeviceState deviceState = createDeviceStateMock(StateType.ON, "On");
404         getBridgeHandler().onDeviceStateUpdated(deviceState);
405         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.ONLINE, ThingStatusDetail.NONE);
406
407         doThrow(MieleWebserviceException.class).when(getWebserviceMock()).putProcessAction(any(),
408                 eq(ProcessAction.STOP));
409
410         // when:
411         getThingHandler().triggerProcessAction(ProcessAction.STOP);
412
413         // then:
414         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.ONLINE, ThingStatusDetail.NONE);
415     }
416
417     @Test
418     public void testHandleCommandProgramStartToStartStopChannel() {
419         // when:
420         getThingHandler().handleCommand(channel(PROGRAM_START_STOP),
421                 new StringType(ProgramStatus.PROGRAM_STARTED.getState()));
422
423         // then:
424         waitForAssert(() -> {
425             verify(getWebserviceMock()).putProcessAction(getThingHandler().getDeviceId(), ProcessAction.START);
426         });
427     }
428
429     @Test
430     public void testHandleCommandProgramStopToStartStopChannel() {
431         // when:
432         getThingHandler().handleCommand(channel(PROGRAM_START_STOP),
433                 new StringType(ProgramStatus.PROGRAM_STOPPED.getState()));
434
435         // then:
436         waitForAssert(() -> {
437             verify(getWebserviceMock()).putProcessAction(getThingHandler().getDeviceId(), ProcessAction.STOP);
438         });
439     }
440
441     @Test
442     public void testHandleCommandProgramStartToStartStopPauseChannel() {
443         // when:
444         getThingHandler().handleCommand(channel(PROGRAM_START_STOP_PAUSE),
445                 new StringType(ProgramStatus.PROGRAM_STARTED.getState()));
446
447         // then:
448         waitForAssert(() -> {
449             verify(getWebserviceMock()).putProcessAction(getThingHandler().getDeviceId(), ProcessAction.START);
450         });
451     }
452
453     @Test
454     public void testHandleCommandProgramStopToStartStopPauseChannel() {
455         // when:
456         getThingHandler().handleCommand(channel(PROGRAM_START_STOP_PAUSE),
457                 new StringType(ProgramStatus.PROGRAM_STOPPED.getState()));
458
459         // then:
460         waitForAssert(() -> {
461             verify(getWebserviceMock()).putProcessAction(getThingHandler().getDeviceId(), ProcessAction.STOP);
462         });
463     }
464
465     @Test
466     public void testHandleCommandProgramPauseToStartStopPauseChannel() {
467         // when:
468         getThingHandler().handleCommand(channel(PROGRAM_START_STOP_PAUSE),
469                 new StringType(ProgramStatus.PROGRAM_PAUSED.getState()));
470
471         // then:
472         waitForAssert(() -> {
473             verify(getWebserviceMock()).putProcessAction(getThingHandler().getDeviceId(), ProcessAction.PAUSE);
474         });
475     }
476
477     @Test
478     public void testFailingPutLightDoesNotSetTheDeviceToOffline() {
479         // given:
480         DeviceState deviceState = createDeviceStateMock(StateType.ON, "On");
481         getBridgeHandler().onDeviceStateUpdated(deviceState);
482         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.ONLINE, ThingStatusDetail.NONE);
483
484         doThrow(MieleWebserviceException.class).when(getWebserviceMock()).putLight(any(), eq(true));
485
486         // when:
487         getThingHandler().triggerLight(true);
488
489         // then:
490         assertThingStatusIs(getThingHandler().getThing(), ThingStatus.ONLINE, ThingStatusDetail.NONE);
491     }
492
493     @Test
494     public void testHandleCommandLightOff() {
495         // when:
496         getThingHandler().handleCommand(channel(LIGHT_SWITCH), OnOffType.OFF);
497
498         // then:
499         waitForAssert(() -> {
500             verify(getWebserviceMock()).putLight(getThingHandler().getDeviceId(), false);
501         });
502     }
503
504     @Test
505     public void testHandleCommandLightOn() {
506         // when:
507         getThingHandler().handleCommand(channel(LIGHT_SWITCH), OnOffType.ON);
508
509         // then:
510         waitForAssert(() -> {
511             verify(getWebserviceMock()).putLight(getThingHandler().getDeviceId(), true);
512         });
513     }
514
515     @Test
516     public void testHandleCommandDoesNothingWhenCommandIsNotOfOnOffType() {
517         // when:
518         getThingHandler().handleCommand(channel(LIGHT_SWITCH), new DecimalType(0));
519
520         // then:
521         verify(getWebserviceMock(), never()).putLight(anyString(), anyBoolean());
522     }
523
524     @Test
525     public void testHandleCommandPowerOn() {
526         // when:
527         getThingHandler().handleCommand(channel(POWER_ON_OFF), OnOffType.ON);
528
529         // then:
530         waitForAssert(() -> {
531             verify(getWebserviceMock()).putPowerState(getThingHandler().getDeviceId(), true);
532         });
533     }
534
535     @Test
536     public void testHandleCommandPowerOff() {
537         // when:
538         getThingHandler().handleCommand(channel(POWER_ON_OFF), OnOffType.OFF);
539
540         // then:
541         waitForAssert(() -> {
542             verify(getWebserviceMock()).putPowerState(getThingHandler().getDeviceId(), false);
543         });
544     }
545
546     @Test
547     public void testHandleCommandDoesNothingWhenPowerCommandIsNotOfOnOffType() {
548         // when:
549         getThingHandler().handleCommand(channel(POWER_ON_OFF), new DecimalType(0));
550
551         // then:
552         verify(getWebserviceMock(), never()).putPowerState(anyString(), anyBoolean());
553     }
554
555     @Test
556     public void testMissingPropertiesAreSetWhenAStateUpdateIsReceivedFromTheCloud() {
557         // given:
558         assertFalse(getThingHandler().getThing().getProperties().containsKey(Thing.PROPERTY_SERIAL_NUMBER));
559         assertFalse(getThingHandler().getThing().getProperties().containsKey(Thing.PROPERTY_MODEL_ID));
560
561         var deviceState = mock(DeviceState.class);
562         when(deviceState.getRawType()).thenReturn(DeviceType.UNKNOWN);
563         when(deviceState.getDeviceIdentifier()).thenReturn(MieleCloudBindingIntegrationTestConstants.SERIAL_NUMBER);
564         when(deviceState.getFabNumber())
565                 .thenReturn(Optional.of(MieleCloudBindingIntegrationTestConstants.SERIAL_NUMBER));
566         when(deviceState.getType()).thenReturn(Optional.of("Unknown device type"));
567         when(deviceState.getTechType()).thenReturn(Optional.of("UK-4567"));
568
569         // when:
570         getThingHandler().onDeviceStateUpdated(deviceState);
571
572         // then:
573         assertEquals(MieleCloudBindingIntegrationTestConstants.SERIAL_NUMBER,
574                 getThingHandler().getThing().getProperties().get(Thing.PROPERTY_SERIAL_NUMBER));
575         assertEquals("Unknown device type UK-4567",
576                 getThingHandler().getThing().getProperties().get(Thing.PROPERTY_MODEL_ID));
577     }
578 }