]> git.basschouten.com Git - openhab-addons.git/blob
090323cd5c27b0a50ad2f0fd8b33190fd901e90c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.max.internal.message;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19
20 /**
21  * Tests cases for {@link FMessage}.
22  *
23  * @author Marcel Verpaalen - Initial contribution
24  */
25 @NonNullByDefault
26 public class FMessageTest {
27
28     public static final String RAW_DATA = "F:nl.ntp.pool.org,ntp.homematic.com";
29
30     private final FMessage message = new FMessage(RAW_DATA);
31
32     @Test
33     public void getMessageTypeTest() {
34         MessageType messageType = ((Message) message).getType();
35         assertEquals(MessageType.F, messageType);
36     }
37
38     @Test
39     public void getServer1Test() {
40         String ntpServer1 = message.getNtpServer1();
41         assertEquals("nl.ntp.pool.org", ntpServer1);
42     }
43
44     @Test
45     public void getServer2Test() {
46         String ntpServer1 = message.getNtpServer2();
47         assertEquals("ntp.homematic.com", ntpServer1);
48     }
49 }