2 * Copyright (c) 2010-2022 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.max.internal.message;
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.binding.max.internal.device.DeviceType;
22 * Tests cases for {@link CMessage}.
24 * @author Andreas Heil (info@aheil.de) - Initial contribution
25 * @author Marcel Verpaalen - OH2 Version and updates
28 public class CMessageTest {
30 public static final String RAW_DATA = "C:0b0da3,0gsNowIBEABLRVEwNTQ0MjQyLCQ9CQcYAzAM/wBIYViRSP1ZFE0gTSBNIEUgRSBFIEUgRSBFIEhhWJFQ/VkVUSBRIFEgRSBFIEUgRSBFIEUgSFBYWkj+WRRNIE0gTSBFIEUgRSBFIEUgRSBIUFhaSP5ZFE0gTSBNIEUgRSBFIEUgRSBFIEhQWFpI/lkUTSBNIE0gRSBFIEUgRSBFIEUgSFBYWkj+WRRNIE0gTSBFIEUgRSBFIEUgRSBIUFhaSP5ZFE0gTSBNIEUgRSBFIEUgRSBFIA==";
31 private final CMessage message = new CMessage(RAW_DATA);
34 public void getMessageTypeTest() {
35 MessageType messageType = ((Message) message).getType();
36 assertEquals(MessageType.C, messageType);
40 public void getRFAddressTest() {
41 String rfAddress = message.getRFAddress();
42 assertEquals("0b0da3", rfAddress);
46 public void getDeviceTypeTest() {
47 DeviceType deviceType = message.getDeviceType();
48 assertEquals(DeviceType.HeatingThermostatPlus, deviceType);
52 public void getSerialNumberTes() {
53 String serialNumber = message.getSerialNumber();
54 assertEquals("KEQ0544242", serialNumber);