From 1548f16f5ed1339918df81283effee2b9f9f50ba Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Thu, 5 Jan 2023 13:28:28 +0100 Subject: [PATCH] [hueemulation] Fix tests after core change (#14161) 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 --- .../internal/rest/mocks/DummyMetadataRegistry.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java index 04606f10431..3c17b7b68ab 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyMetadataRegistry.java @@ -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 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) { }