]> git.basschouten.com Git - openhab-addons.git/commitdiff
[hueemulation] Fix tests after core change (#14161)
authorFlorian Hotze <florianh_dev@icloud.com>
Thu, 5 Jan 2023 12:28:28 +0000 (13:28 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Jan 2023 12:28:28 +0000 (13:28 +0100)
Fixes #14153.
This fixes the Hue Emulation tests (and in consequence the full addons build) after core change https://github.com/openhab/openhab-core/pull/3298.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java

index 04606f104316741d0b68095eb872c5a31388c8f6..3c17b7b68abdf1c7137f413c7b66e467a6874905 100644 (file)
@@ -17,6 +17,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -95,6 +96,12 @@ public class DummyMetadataRegistry implements MetadataRegistry {
         return false;
     }
 
+    @Override
+    public Collection<String> getAllNamespaces(String itemname) {
+        return stream().map(Metadata::getUID).filter(key -> key.getItemName().equals(itemname))
+                .map(MetadataKey::getNamespace).collect(Collectors.toSet());
+    }
+
     @Override
     public void removeItemMetadata(String name) {
     }