2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.miele.internal;
15 import static org.junit.jupiter.api.Assertions.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.core.test.java.JavaTest;
22 * This class provides test cases for {@link
23 * org.openhab.binding.miele.internal.FullyQualifiedApplianceIdentifier}
25 * @author Jacob Laursen - Initial contribution
28 public class FullyQualifiedApplianceIdentifierTest extends JavaTest {
31 public void getUidWhenConstructedFromUidReturnsUid() {
32 var identifier = new FullyQualifiedApplianceIdentifier("hdm:ZigBee:0123456789abcdef#210");
33 assertEquals("hdm:ZigBee:0123456789abcdef#210", identifier.getUid());
37 public void getUidWhenConstructedFromApplianceIdAndProtocolReturnsUid() {
38 var identifier = new FullyQualifiedApplianceIdentifier("0123456789abcdef#210", "hdm:LAN:");
39 assertEquals("hdm:LAN:0123456789abcdef#210", identifier.getUid());
43 public void getApplianceIdWhenConstructedFromUidReturnsApplianceId() {
44 var identifier = new FullyQualifiedApplianceIdentifier("hdm:ZigBee:0123456789abcdef#210");
45 assertEquals("0123456789abcdef#210", identifier.getApplianceId());
49 public void getApplianceIdWhenConstructedFromApplianceIdAndProtocolReturnsApplianceId() {
50 var identifier = new FullyQualifiedApplianceIdentifier("0123456789abcdef#210", "hdm:LAN:");
51 assertEquals("0123456789abcdef#210", identifier.getApplianceId());
55 public void getIdWhenConstructedFromUidReturnsProtocol() {
56 var identifier = new FullyQualifiedApplianceIdentifier("hdm:ZigBee:0123456789abcdef#210");
57 assertEquals("0123456789abcdef_210", identifier.getId());
61 public void getIdWhenConstructedFromApplianceIdAndProtocolReturnsProtocol() {
62 var identifier = new FullyQualifiedApplianceIdentifier("0123456789abcdef#210", "hdm:LAN:");
63 assertEquals("0123456789abcdef_210", identifier.getId());
67 public void getProtocolWhenConstructedFromUidReturnsProtocol() {
68 var identifier = new FullyQualifiedApplianceIdentifier("hdm:ZigBee:0123456789abcdef#210");
69 assertEquals("hdm:ZigBee:", identifier.getProtocol());
73 public void getProtocolWhenConstructedFromApplianceIdAndProtocolReturnsProtocol() {
74 var identifier = new FullyQualifiedApplianceIdentifier("0123456789abcdef#210", "hdm:LAN:");
75 assertEquals("hdm:LAN:", identifier.getProtocol());