From 3d8ae8596caf7f94d9f3bbd2f016404ff41d23da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 28 Oct 2023 15:53:47 +0100 Subject: [PATCH] Fix unit tests --- .../gadgetbridge/database/EntitiesTest.java | 2 +- .../gadgetbridge/model/DeviceTypeTest.java | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/database/EntitiesTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/database/EntitiesTest.java index 7c4f47461..16f6d349f 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/database/EntitiesTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/database/EntitiesTest.java @@ -88,7 +88,7 @@ public class EntitiesTest extends TestBase { assertEquals("00:00:00:00:01", device.getIdentifier()); assertEquals("Testie", device.getName()); assertEquals("4.0", device.getModel()); - assertEquals(DeviceType.TEST.getKey(), device.getType()); + assertEquals(DeviceType.TEST.name(), device.getTypeName()); DeviceAttributes attributes = device.getDeviceAttributesList().get(0); assertNotNull(attributes); assertEquals("1.2.3", attributes.getFirmwareVersion1()); diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceTypeTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceTypeTest.java index a3ad7c8dc..04aa25233 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceTypeTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/model/DeviceTypeTest.java @@ -19,28 +19,10 @@ package nodomain.freeyourgadget.gadgetbridge.model; import org.junit.Assert; import org.junit.Test; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.test.TestBase; public class DeviceTypeTest extends TestBase { - @Test - public void ensureNoDuplicateKeys() { - final Set knownKeys = new HashSet<>(); - - final List duplicateKeys = Arrays.stream(DeviceType.values()) - .map(DeviceType::getKey) - .filter(k -> !knownKeys.add(k)) - .collect(Collectors.toList()); - - Assert.assertTrue("There are duplicated device keys: " + duplicateKeys, duplicateKeys.isEmpty()); - } - @Test public void ensureNoMissingDeviceInfo() { // Check that all coordinators for all device types declare valid device names, icons and manufacturer