]> git.basschouten.com Git - openhab-addons.git/blob
41cb66df2e2e2ca6c7e6ba1a4b84e57968944ead
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.tplinksmarthome.internal.device;
14
15 import static org.hamcrest.MatcherAssert.assertThat;
16 import static org.hamcrest.core.Is.is;
17
18 import java.io.IOException;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.junit.jupiter.api.Test;
22
23 /**
24  * Test class to test if text read from the device is correctly decoded to handle special characters.
25  *
26  * @author Hilbrand Bouwkamp - Initial contribution
27  */
28 @NonNullByDefault
29 public class EncodingTest extends DeviceTestBase<SwitchDevice> {
30
31     public EncodingTest() throws IOException {
32         super(new SwitchDevice(), "encoding_test");
33     }
34
35     @Test
36     public void testCorrectDecodingOfText() throws IOException {
37         assertThat("Alias incorrectly decoded", deviceState.getSysinfo().getAlias(), is("MyßmärtPlug"));
38     }
39 }