2 * Copyright (c) 2010-2022 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.govee.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.junit.jupiter.api.Assertions;
17 import org.junit.jupiter.api.DisplayName;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.binding.bluetooth.MockBluetoothAdapter;
20 import org.openhab.binding.bluetooth.MockBluetoothDevice;
21 import org.openhab.binding.bluetooth.TestUtils;
22 import org.openhab.binding.bluetooth.discovery.BluetoothDiscoveryDevice;
25 * @author Connor Petty - Initial contribution
29 class GoveeModelTest {
31 // the participant is stateless so this is fine.
32 // private GoveeDiscoveryParticipant participant = new GoveeDiscoveryParticipant();
36 MockBluetoothAdapter adapter = new MockBluetoothAdapter();
37 MockBluetoothDevice mockDevice = adapter.getDevice(TestUtils.randomAddress());
38 mockDevice.setName("asdfasdf");
40 Assertions.assertNull(GoveeModel.getGoveeModel(new BluetoothDiscoveryDevice(mockDevice)));
44 @DisplayName("testGovee_H5074_84DD")
45 void testGoveeH507484DD() {
46 MockBluetoothAdapter adapter = new MockBluetoothAdapter();
47 MockBluetoothDevice mockDevice = adapter.getDevice(TestUtils.randomAddress());
48 mockDevice.setName("Govee_H5074_84DD");
50 Assertions.assertEquals(GoveeModel.H5074, GoveeModel.getGoveeModel(new BluetoothDiscoveryDevice(mockDevice)));
54 @DisplayName("testGVH5102_77E9")
55 void testGVH510277E9() {
56 MockBluetoothAdapter adapter = new MockBluetoothAdapter();
57 MockBluetoothDevice mockDevice = adapter.getDevice(TestUtils.randomAddress());
58 mockDevice.setName("GVH5102_77E9");
60 Assertions.assertEquals(GoveeModel.H5102, GoveeModel.getGoveeModel(new BluetoothDiscoveryDevice(mockDevice)));