diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java index 26e16582dde2a..344ec0588a77f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/glassfish/jersey/servlet/init/JerseyServletContainerInitializer.java @@ -25,7 +25,7 @@ */ public class JerseyServletContainerInitializer implements ServletContainerInitializer { @Override - public void onStartup(Set> c, ServletContext ctx) throws ServletException { + public void onStartup(Set> c, ServletContext ctx) { } } diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java index 680c9eda7c562..d7133f31adbd2 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationService.java @@ -91,8 +91,7 @@ public static class JerseyApplication extends Application { public class LogAccessInterceptor implements ContainerResponseFilter { @NonNullByDefault({}) @Override - public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) - throws IOException { + public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { if (!logger.isDebugEnabled()) { return; diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java index a6e0cbec60ba9..4d56fb1e4f116 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/automation/TimerTriggerHandler.java @@ -113,7 +113,7 @@ public synchronized void dispose() { } @Override - public Duration call() throws Exception { + public Duration call() { ((TriggerHandlerCallback) callback).triggered(module, null); config.repeat -= 1; if (config.repeat == 0) { diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java index 09ba6045c7959..53ef26ffa613f 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/ConfigurationAccess.java @@ -78,7 +78,7 @@ public Response getReducedConfigApi() { @ApiOperation(value = "Return the full data store") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response getAllApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } @@ -91,7 +91,7 @@ public Response getAllApi(@Context UriInfo uri, @ApiOperation(value = "Return the configuration") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response getFullConfigApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } @@ -104,7 +104,7 @@ public Response getFullConfigApi(@Context UriInfo uri, @ApiOperation(value = "Return the reduced configuration") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response putFullConfigApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username, String body) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username, String body) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java index 56b30bc5544fc..7f16240bc0419 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Rules.java @@ -239,7 +239,7 @@ protected static List createActions(String uid, List hueActi @ApiOperation(value = "Return all rules") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response getRulesApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java index 64d6529efcbe6..7ee44ba57b102 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Scenes.java @@ -169,7 +169,7 @@ public void updated(Rule oldElement, Rule element) { @ApiOperation(value = "Return all scenes") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response getScenesApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java index 29e749e31ec9a..80472599edca8 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/rest/Schedules.java @@ -232,7 +232,7 @@ protected static Rule createRule(String uid, RuleBuilder builder, List o @ApiOperation(value = "Return all schedules") @ApiResponses(value = { @ApiResponse(code = 200, message = "OK") }) public Response getSchedulesApi(@Context UriInfo uri, - @PathParam("username") @ApiParam(value = "username") String username) throws IOException { + @PathParam("username") @ApiParam(value = "username") String username) { if (!userManagement.authorizeUser(username)) { return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized"); } diff --git a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java index 11d5de2faffc1..e43b62c3678b3 100644 --- a/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java +++ b/bundles/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/upnp/UpnpServer.java @@ -17,16 +17,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.Inet4Address; -import java.net.Inet6Address; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.NetworkInterface; -import java.net.SocketAddress; -import java.net.StandardSocketOptions; -import java.net.UnknownHostException; +import java.net.*; import java.nio.ByteBuffer; import java.nio.channels.ClosedSelectorException; import java.nio.channels.DatagramChannel; @@ -37,7 +28,6 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.ForkJoinPool; @@ -155,7 +145,7 @@ public UpnpServer(Executor executor) { */ @NonNullByDefault({}) @Override - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { if (xmlDocWithAddress == null || xmlDocWithAddress.isEmpty()) { resp.sendError(HttpServletResponse.SC_NOT_FOUND); return; @@ -208,7 +198,7 @@ protected void activate() { } private void useAddressPort(HueEmulationConfigWithRuntime r) { - final String urlBase = "http://" + r.addressString + ":" + String.valueOf(r.port); + final String urlBase = "http://" + r.addressString + ":" + r.port; this.baseurl = urlBase + DISCOVERY_FILE; final String[] stVersions = { "upnp:rootdevice", "urn:schemas-upnp-org:device:basic:1", @@ -271,7 +261,7 @@ private void useAddressPort(HueEmulationConfigWithRuntime r) { ip = "[" + ip.split("%")[0] + "]"; } try { - url = "http://" + ip + ":" + String.valueOf(config.port) + DISCOVERY_FILE; + url = "http://" + ip + ":" + config.port + DISCOVERY_FILE; response = client.target(url).request().get(); boolean isOurs = response.readEntity(String.class).contains(cs.ds.config.bridgeid); selfTests.add(new SelfTestReport(url, response.getStatus() == 200, isOurs)); @@ -308,7 +298,7 @@ private void useAddressPort(HueEmulationConfigWithRuntime r) { r = new HueEmulationConfigWithRuntime(this, cs.getConfig(), cs.ds.config.ipaddress, MULTI_ADDR_IPV4, MULTI_ADDR_IPV6); } catch (UnknownHostException e) { - logger.warn("The picked default IP address is not valid: ", e.getMessage()); + logger.warn("The picked default IP address is not valid: {}", e.getMessage()); throw new IllegalStateException(e); } return r; @@ -363,8 +353,6 @@ public synchronized void handleEvent(@Nullable Event event) { /** * Stops the upnp server from running - * - * @throws InterruptedException */ @Deactivate public void deactivate() { @@ -375,7 +363,7 @@ public void deactivate() { } } - private void handleRead(SelectionKey key, Set addresses) throws IOException { + private void handleRead(SelectionKey key) throws IOException { logger.trace("upnp thread handle received message"); DatagramChannel channel = (DatagramChannel) key.channel(); ClientRecord clntRec = (ClientRecord) key.attachment(); @@ -424,22 +412,25 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { boolean hasIPv4 = false; boolean hasIPv6 = false; - try (DatagramChannel channel = DatagramChannel.open(); Selector selector = Selector.open()) { + try ( + DatagramChannel channelV4 = DatagramChannel.open(StandardProtocolFamily.INET); + DatagramChannel channelV6 = DatagramChannel.open(StandardProtocolFamily.INET6); + Selector selector = Selector.open()) { threadContext.asyncIOselector = selector; - channel.setOption(StandardSocketOptions.SO_REUSEADDR, true) - .setOption(StandardSocketOptions.IP_MULTICAST_LOOP, true).bind(new InetSocketAddress(UPNP_PORT)); + bind(channelV4); + bind(channelV6); for (InetAddress address : cs.getDiscoveryIps()) { NetworkInterface networkInterface = NetworkInterface.getByInetAddress(address); if (networkInterface == null) { continue; } if (address instanceof Inet4Address) { - channel.join(MULTI_ADDR_IPV4, networkInterface); + channelV4.join(MULTI_ADDR_IPV4, networkInterface); hasIPv4 = true; } else { - channel.join(MULTI_ADDR_IPV6, networkInterface); + channelV6.join(MULTI_ADDR_IPV6, networkInterface); hasIPv6 = true; } } @@ -450,16 +441,18 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { return; } - channel.configureBlocking(false); - channel.register(selector, SelectionKey.OP_READ, new ClientRecord()); if (hasIPv4) { + channelV4.configureBlocking(false); + channelV4.register(selector, SelectionKey.OP_READ, new ClientRecord()); try (DatagramSocket sendSocket = new DatagramSocket(new InetSocketAddress(config.address, 0))) { sendUPNPDatagrams(sendSocket, MULTI_ADDR_IPV4, UPNP_PORT); } } if (hasIPv6) { + channelV6.configureBlocking(false); + channelV6.register(selector, SelectionKey.OP_READ, new ClientRecord()); try (DatagramSocket sendSocket = new DatagramSocket()) { sendUPNPDatagrams(sendSocket, MULTI_ADDR_IPV6, UPNP_PORT); } @@ -475,7 +468,7 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { while (keyIter.hasNext()) { SelectionKey key = keyIter.next(); if (key.isReadable()) { - handleRead(key, cs.getDiscoveryIps()); + handleRead(key); } keyIter.remove(); } @@ -504,6 +497,12 @@ public void accept(HueEmulationConfigWithRuntime threadContext) { } } + private void bind(DatagramChannel channel) throws IOException { + channel.setOption(StandardSocketOptions.SO_REUSEADDR, true) + .setOption(StandardSocketOptions.IP_MULTICAST_LOOP, true) + .bind(new InetSocketAddress(UPNP_PORT)); + } + /** * The upnp server performs some self-tests * diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java index d972fbfb128ca..738cc9be11f80 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/automation/RuleConditionHandlerTests.java @@ -67,7 +67,7 @@ protected LocalDateTime getNow() { } @Before - public void setUp() throws IOException { + public void setUp() { ds = new HueDataStore(); ds.lights.put("1", new HueLightEntry(new SwitchItem("switch"), "switch", DeviceType.SwitchType)); diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java index cf99574e590a9..796c3b8cfd9b0 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/LightsAndGroupsTests.java @@ -89,7 +89,7 @@ public void tearDown() { } @Test - public void addSwitchableByCategory() throws IOException { + public void addSwitchableByCategory() { SwitchItem item = new SwitchItem("switch1"); item.setCategory("Light"); itemRegistry.add(item); @@ -100,7 +100,7 @@ public void addSwitchableByCategory() throws IOException { } @Test - public void addSwitchableByTag() throws IOException { + public void addSwitchableByTag() { SwitchItem item = new SwitchItem("switch1"); item.addTag("Switchable"); itemRegistry.add(item); @@ -110,7 +110,7 @@ public void addSwitchableByTag() throws IOException { } @Test - public void ignoreByTag() throws IOException { + public void ignoreByTag() { SwitchItem item = new SwitchItem("switch1"); item.addTags("Switchable", "internal"); // The ignore tag will win itemRegistry.add(item); @@ -119,7 +119,7 @@ public void ignoreByTag() throws IOException { } @Test - public void addGroupSwitchableByTag() throws IOException { + public void addGroupSwitchableByTag() { GroupItem item = new GroupItem("group1", new SwitchItem("switch1")); item.addTag("Switchable"); itemRegistry.add(item); @@ -129,7 +129,7 @@ public void addGroupSwitchableByTag() throws IOException { } @Test - public void addGroupWithoutTypeByTag() throws IOException { + public void addGroupWithoutTypeByTag() { GroupItem item = new GroupItem("group1", null); item.addTag("Switchable"); @@ -142,7 +142,7 @@ public void addGroupWithoutTypeByTag() throws IOException { } @Test - public void removeGroupWithoutTypeAndTag() throws IOException { + public void removeGroupWithoutTypeAndTag() { String groupName = "group1"; GroupItem item = new GroupItem(groupName, null); item.addTag("Switchable"); @@ -157,7 +157,7 @@ public void removeGroupWithoutTypeAndTag() throws IOException { } @Test - public void updateSwitchable() throws IOException { + public void updateSwitchable() { SwitchItem item = new SwitchItem("switch1"); item.setLabel("labelOld"); item.addTag("Switchable"); @@ -187,7 +187,7 @@ public void updateSwitchable() throws IOException { } @Test - public void changeSwitchState() throws IOException { + public void changeSwitchState() { assertThat(((HueStatePlug) cs.ds.lights.get("1").state).on, is(false)); @@ -204,7 +204,7 @@ public void changeSwitchState() throws IOException { } @Test - public void changeGroupItemSwitchState() throws IOException { + public void changeGroupItemSwitchState() { assertThat(((HueStatePlug) cs.ds.groups.get("10").action).on, is(false)); @@ -221,7 +221,7 @@ public void changeGroupItemSwitchState() throws IOException { } @Test - public void changeOnValue() throws IOException { + public void changeOnValue() { assertThat(((HueStateColorBulb) cs.ds.lights.get("2").state).on, is(false)); @@ -235,7 +235,7 @@ public void changeOnValue() throws IOException { } @Test - public void changeOnAndBriValues() throws IOException { + public void changeOnAndBriValues() { assertThat(((HueStateColorBulb) cs.ds.lights.get("2").state).on, is(false)); assertThat(((HueStateColorBulb) cs.ds.lights.get("2").state).bri, is(0)); @@ -250,7 +250,7 @@ public void changeOnAndBriValues() throws IOException { } @Test - public void changeHueSatValues() throws IOException { + public void changeHueSatValues() { HueLightEntry hueDevice = cs.ds.lights.get("2"); hueDevice.item.setState(OnOffType.ON); hueDevice.state.as(HueStateColorBulb.class).on = true; @@ -271,7 +271,7 @@ public void changeHueSatValues() throws IOException { * Amazon echos are setting ct only, if commanded to turn a light white. */ @Test - public void changeCtValue() throws IOException { + public void changeCtValue() { HueLightEntry hueDevice = cs.ds.lights.get("2"); hueDevice.item.setState(OnOffType.ON); hueDevice.state.as(HueStateColorBulb.class).on = true; @@ -292,7 +292,7 @@ public void changeCtValue() throws IOException { } @Test - public void switchOnWithXY() throws IOException { + public void switchOnWithXY() { assertThat(((HueStateColorBulb) cs.ds.lights.get("2").state).on, is(false)); assertThat(((HueStateColorBulb) cs.ds.lights.get("2").state).bri, is(0)); @@ -313,8 +313,7 @@ public void switchOnWithXY() throws IOException { } @Test - public void allLightsAndSingleLight() - throws InterruptedException, ExecutionException, TimeoutException, IOException { + public void allLightsAndSingleLight() { Response response = commonSetup.client.target(commonSetup.basePath + "/testuser/lights").request().get(); assertEquals(200, response.getStatus()); diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java index 4418ecaf0838b..a6e5583f2423f 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/SensorTests.java @@ -92,7 +92,7 @@ public void tearDown() { } @Test - public void renameSensor() throws IOException { + public void renameSensor() { assertThat(cs.ds.sensors.get("switch1").name, is("name1")); @@ -107,7 +107,7 @@ public void renameSensor() throws IOException { } @Test - public void allAndSingleSensor() throws InterruptedException, ExecutionException, TimeoutException, IOException { + public void allAndSingleSensor() { Response response = commonSetup.client.target(commonSetup.basePath + "/testuser/sensors").request().get(); assertEquals(200, response.getStatus()); diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java index 12727fb1045a0..1c6dd124e796f 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/UsersAndConfigTests.java @@ -68,17 +68,17 @@ public void tearDown() { } @Test - public void invalidUser() throws IOException { + public void invalidUser() { assertFalse(commonSetup.userManagement.authorizeUser("blub")); } @Test - public void validUser() throws IOException { + public void validUser() { assertTrue(commonSetup.userManagement.authorizeUser("testuser")); } @Test - public void configStoreRestartOnNoUUID() throws IOException { + public void configStoreRestartOnNoUUID() { ConfigStore configStore = new ConfigStoreWithoutMetadata(commonSetup.networkAddressService, commonSetup.configAdmin, commonSetup.scheduler); @@ -95,7 +95,7 @@ public void configStoreRestartOnNoUUID() throws IOException { } @Test - public void addUser() throws IOException { + public void addUser() { // GET should fail assertEquals(405, commonSetup.client.target(commonSetup.basePath).request().get().getStatus()); @@ -123,8 +123,7 @@ public void addUser() throws IOException { } @Test - public void UnauthorizedAccessTest() - throws InterruptedException, ExecutionException, TimeoutException, IOException { + public void UnauthorizedAccessTest() { // Unauthorized config Response response; diff --git a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java index aa7c366b49648..200a4d6f109c7 100644 --- a/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java +++ b/bundles/org.openhab.io.hueemulation/src/test/java/org/openhab/io/hueemulation/internal/rest/mocks/DummyItemRegistry.java @@ -90,12 +90,12 @@ public Item add(Item element) { } @Override - public Item getItem(@Nullable String name) throws ItemNotFoundException { + public Item getItem(@Nullable String name) { return items.get(name); } @Override - public Item getItemByPattern(String name) throws ItemNotFoundException, ItemNotUniqueException { + public Item getItemByPattern(String name) { return items.get(name); }