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.bluetooth.am43;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.junit.Assert;
17 import org.junit.Test;
18 import org.openhab.binding.bluetooth.am43.internal.command.ControlCommand;
19 import org.openhab.binding.bluetooth.am43.internal.command.GetAllCommand;
20 import org.openhab.binding.bluetooth.am43.internal.data.ControlAction;
21 import org.openhab.core.util.HexUtils;
25 * @author Connor Petty - Initial contribution
28 public class CommandTest {
31 public void findAllCommandTest() {
32 byte[] expected = HexUtils.hexToBytes("00ff00009aa701013d");
33 byte[] actual = new GetAllCommand().getRequest();
34 Assert.assertArrayEquals(expected, actual);
38 public void controlStopCommandTest() {
39 byte[] expected = HexUtils.hexToBytes("00ff00009a0a01cc5d");
40 byte[] actual = new ControlCommand(ControlAction.STOP).getRequest();
42 Assert.assertArrayEquals(expected, actual);
46 public void controlOpenCommandTest() {
47 byte[] expected = HexUtils.hexToBytes("00ff00009a0a01dd4c");
48 byte[] actual = new ControlCommand(ControlAction.OPEN).getRequest();
50 Assert.assertArrayEquals(expected, actual);