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.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 NMessage}.
24 * @author Marcel Verpaalen - Initial contribution
27 public class NMessageTest {
29 public static final String RAW_DATA = "N:Aw4VzExFUTAwMTUzNDD/";
30 // public final String rawData = "N:AQe250tFUTAxNDUxNzL/";
32 private NMessage message = new NMessage(RAW_DATA);
35 public void getMessageTypeTest() {
36 MessageType messageType = ((Message) message).getType();
37 assertEquals(MessageType.N, messageType);
41 public void getRFAddressTest() {
42 String rfAddress = message.getRfAddress();
44 assertEquals("0E15CC", rfAddress);
48 public void getSerialNumberTest() {
49 String serialNumber = message.getSerialNumber();
51 assertEquals("LEQ0015340", serialNumber);
55 public void getDeviceTypeTest() {
56 DeviceType deviceType = message.getDeviceType();
58 assertEquals(DeviceType.WallMountedThermostat, deviceType);