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.lcn.internal.subhandler;
15 import static org.mockito.Mockito.verify;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.BeforeEach;
19 import org.junit.jupiter.api.Test;
20 import org.openhab.binding.lcn.internal.common.LcnChannelGroup;
21 import org.openhab.binding.lcn.internal.common.LcnException;
22 import org.openhab.core.library.types.PercentType;
27 * @author Fabian Wolter - Initial contribution
30 public class LcnModuleRollershutterRelaySlatAngleSubHandlerTest extends AbstractTestLcnModuleSubHandler {
31 private @NonNullByDefault({}) AbstractLcnModuleRollershutterRelaySubHandler l;
38 l = new LcnModuleRollershutterRelaySlatAngleSubHandler(handler, info);
42 public void testMotor1percent0() throws LcnException {
43 l.handleCommandPercent(PercentType.ZERO, LcnChannelGroup.ROLLERSHUTTERRELAYSLAT, 0);
44 verify(handler).sendPck("JW000001");
48 public void testMotor1percent100() throws LcnException {
49 l.handleCommandPercent(PercentType.HUNDRED, LcnChannelGroup.ROLLERSHUTTERRELAYSLAT, 0);
50 verify(handler).sendPck("JW100001");
54 public void testMotor1percent50() throws LcnException {
55 l.handleCommandPercent(new PercentType(50), LcnChannelGroup.ROLLERSHUTTERRELAYSLAT, 0);
56 verify(handler).sendPck("JW050001");
60 public void testMotor4percent50() throws LcnException {
61 l.handleCommandPercent(new PercentType(50), LcnChannelGroup.ROLLERSHUTTERRELAYSLAT, 3);
62 verify(handler).sendPck("JW050008");