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.netatmo.internal.handler.channelhelper;
15 import static org.junit.jupiter.api.Assertions.*;
16 import static org.openhab.binding.netatmo.internal.NetatmoBindingConstants.*;
18 import java.util.Collections;
20 import org.junit.jupiter.api.BeforeEach;
21 import org.junit.jupiter.api.Test;
22 import org.openhab.binding.netatmo.internal.api.data.EventType;
23 import org.openhab.binding.netatmo.internal.api.dto.HomeEvent;
24 import org.openhab.core.library.types.StringType;
25 import org.openhab.core.types.State;
28 * @author Sven Strohschein - Initial contribution
30 public class EventCameraChannelHelperTest {
32 private EventCameraChannelHelper helper;
35 public void before() {
36 helper = new EventCameraChannelHelper(Collections.emptySet());
40 public void testInternalGetHomeEventGroupSubEvent() {
41 State state = helper.internalGetHomeEvent(CHANNEL_EVENT_TYPE, GROUP_SUB_EVENT, new HomeEvent());
42 assertTrue(state instanceof StringType);
43 assertEquals(EventType.UNKNOWN.name(), state.toString());
47 public void testInternalGetHomeEventGroupDoorbellSubEvent() {
48 State state = helper.internalGetHomeEvent(CHANNEL_EVENT_TYPE, GROUP_DOORBELL_SUB_EVENT, new HomeEvent());
49 assertTrue(state instanceof StringType);
50 assertEquals(EventType.UNKNOWN.name(), state.toString());
54 public void testInternalGetHomeEventGroupDoorbellStatus() {
55 State state = helper.internalGetHomeEvent(CHANNEL_EVENT_TYPE, GROUP_DOORBELL_STATUS, new HomeEvent());
56 // Only sub-event groups are handled by EventCameraChannelHelper. GROUP_DOORBELL_STATUS isn't a sub-event group.