2 * Copyright (c) 2010-2021 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.Test;
18 import org.openhab.binding.bluetooth.MockBluetoothAdapter;
19 import org.openhab.binding.bluetooth.MockBluetoothDevice;
20 import org.openhab.binding.bluetooth.TestUtils;
21 import org.openhab.binding.bluetooth.discovery.BluetoothDiscoveryDevice;
24 * @author Connor Petty - Initial contribution
28 class GoveeModelTest {
30 // the participant is stateless so this is fine.
31 // private GoveeDiscoveryParticipant participant = new GoveeDiscoveryParticipant();
35 MockBluetoothAdapter adapter = new MockBluetoothAdapter();
36 MockBluetoothDevice mockDevice = adapter.getDevice(TestUtils.randomAddress());
37 mockDevice.setName("asdfasdf");
39 Assertions.assertNull(GoveeModel.getGoveeModel(new BluetoothDiscoveryDevice(mockDevice)));
43 void testGovee_H5074_84DD() {
44 MockBluetoothAdapter adapter = new MockBluetoothAdapter();
45 MockBluetoothDevice mockDevice = adapter.getDevice(TestUtils.randomAddress());
46 mockDevice.setName("Govee_H5074_84DD");
48 Assertions.assertEquals(GoveeModel.H5074, GoveeModel.getGoveeModel(new BluetoothDiscoveryDevice(mockDevice)));