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.OnOffType;
27 * @author Fabian Wolter - Initial contribution
30 public class LcnModuleRvarLockSubHandlerTest extends AbstractTestLcnModuleSubHandler {
31 private @NonNullByDefault({}) LcnModuleRvarLockSubHandler l;
38 l = new LcnModuleRvarLockSubHandler(handler, info);
42 public void testLock1() throws LcnException {
43 l.handleCommandOnOff(OnOffType.ON, LcnChannelGroup.RVARLOCK, 0);
44 verify(handler).sendPck("REAXS");
48 public void testLock2() throws LcnException {
49 l.handleCommandOnOff(OnOffType.ON, LcnChannelGroup.RVARLOCK, 1);
50 verify(handler).sendPck("REBXS");
54 public void testUnlock1() throws LcnException {
55 l.handleCommandOnOff(OnOffType.OFF, LcnChannelGroup.RVARLOCK, 0);
56 verify(handler).sendPck("REAXA");
60 public void testUnlock2() throws LcnException {
61 l.handleCommandOnOff(OnOffType.OFF, LcnChannelGroup.RVARLOCK, 1);
62 verify(handler).sendPck("REBXA");