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.bluetooth.am43;
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.bluetooth.am43.internal.command.ControlCommand;
20 import org.openhab.binding.bluetooth.am43.internal.command.GetAllCommand;
21 import org.openhab.binding.bluetooth.am43.internal.data.ControlAction;
22 import org.openhab.core.util.HexUtils;
26 * @author Connor Petty - Initial contribution
29 public class CommandTest {
32 public void findAllCommandTest() {
33 byte[] expected = HexUtils.hexToBytes("00ff00009aa701013d");
34 byte[] actual = new GetAllCommand().getRequest();
35 assertArrayEquals(expected, actual);
39 public void controlStopCommandTest() {
40 byte[] expected = HexUtils.hexToBytes("00ff00009a0a01cc5d");
41 byte[] actual = new ControlCommand(ControlAction.STOP).getRequest();
43 assertArrayEquals(expected, actual);
47 public void controlOpenCommandTest() {
48 byte[] expected = HexUtils.hexToBytes("00ff00009a0a01dd4c");
49 byte[] actual = new ControlCommand(ControlAction.OPEN).getRequest();
51 assertArrayEquals(expected, actual);