2 * Copyright (c) 2010-2020 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.caddx.internal.message;
15 import static org.junit.jupiter.api.Assertions.*;
17 import java.util.Arrays;
18 import java.util.List;
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.junit.jupiter.params.ParameterizedTest;
22 import org.junit.jupiter.params.provider.MethodSource;
23 import org.openhab.binding.caddx.internal.CaddxMessage;
24 import org.openhab.binding.caddx.internal.CaddxMessageReaderUtil;
27 * Test class for CaddxMessage.
29 * @author Georgios Moutsos - Initial contribution
32 public class CaddxMessageParseTest {
35 public static final List<Object[]> data() {
36 return Arrays.asList(new Object[][] {
37 { "zone_status_message", "zone_number", "4", },
38 { "interface_configuration_message", "panel_firmware_version", "5.37", },
39 { "interface_configuration_message", "panel_interface_configuration_message", "true", },
47 public void testParsing(String messageName, String property, String value) {
48 CaddxMessage message = CaddxMessageReaderUtil.readCaddxMessage(messageName);
50 assertNotNull(message, "Should not be null");
51 assertEquals(value, message.getPropertyById(property), property + " should be: " + value);