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.StopMoveType;
23 import org.openhab.core.library.types.UpDownType;
28 * @author Fabian Wolter - Initial contribution
31 public class LcnModuleRollershutterOutputSubHandlerTest extends AbstractTestLcnModuleSubHandler {
32 private @NonNullByDefault({}) LcnModuleRollershutterOutputSubHandler l;
39 l = new LcnModuleRollershutterOutputSubHandler(handler, info);
43 public void testUp() throws LcnException {
44 l.handleCommandUpDown(UpDownType.UP, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0, false);
45 verify(handler).sendPck("A1DI100008");
49 public void testUpInverted() throws LcnException {
50 l.handleCommandUpDown(UpDownType.UP, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0, true);
51 verify(handler).sendPck("A2DI100008");
55 public void testDown() throws LcnException {
56 l.handleCommandUpDown(UpDownType.DOWN, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0, false);
57 verify(handler).sendPck("A2DI100008");
61 public void testDownInverted() throws LcnException {
62 l.handleCommandUpDown(UpDownType.DOWN, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0, true);
63 verify(handler).sendPck("A1DI100008");
67 public void testStop() throws LcnException {
68 l.handleCommandStopMove(StopMoveType.STOP, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0);
69 verify(handler).sendPck("A1DI000000");
70 verify(handler).sendPck("A2DI000000");
74 public void testMove() throws LcnException {
75 l.handleCommandStopMove(StopMoveType.MOVE, LcnChannelGroup.ROLLERSHUTTEROUTPUT, 0);
76 verify(handler).sendPck("A2DI100008");