diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractBatteryPoweredDeviceHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractBatteryPoweredDeviceHandler.java
index 316cb2c145e..be5fb8a42c7 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractBatteryPoweredDeviceHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractBatteryPoweredDeviceHandler.java
@@ -37,7 +37,7 @@ public abstract class AbstractBatteryPoweredDeviceHandler extends BoschSHCDevice
*/
private final BatteryLevelService batteryLevelService;
- public AbstractBatteryPoweredDeviceHandler(Thing thing) {
+ protected AbstractBatteryPoweredDeviceHandler(Thing thing) {
super(thing);
this.batteryLevelService = new BatteryLevelService();
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractPowerSwitchHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractPowerSwitchHandler.java
index 0d3bcbdd0ec..77de3a4ce29 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractPowerSwitchHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractPowerSwitchHandler.java
@@ -74,8 +74,8 @@ public abstract class AbstractPowerSwitchHandler extends BoschSHCDeviceHandler {
switch (channelUID.getId()) {
case CHANNEL_POWER_SWITCH:
- if (command instanceof OnOffType) {
- updatePowerSwitchState((OnOffType) command);
+ if (command instanceof OnOffType onOffCommand) {
+ updatePowerSwitchState(onOffCommand);
}
break;
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractSmokeDetectorHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractSmokeDetectorHandler.java
index 3db982c14c1..6363d1b713b 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractSmokeDetectorHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/AbstractSmokeDetectorHandler.java
@@ -36,7 +36,7 @@ public abstract class AbstractSmokeDetectorHandler extends AbstractBatteryPowere
private SmokeDetectorCheckService smokeDetectorCheckService;
- public AbstractSmokeDetectorHandler(Thing thing) {
+ protected AbstractSmokeDetectorHandler(Thing thing) {
super(thing);
this.smokeDetectorCheckService = new SmokeDetectorCheckService();
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandler.java
index 6e4259e70d8..14ab1003dc2 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandler.java
@@ -12,8 +12,7 @@
*/
package org.openhab.binding.boschshc.internal.devices.camera;
-import static org.openhab.binding.boschshc.internal.devices.BoschSHCBindingConstants.CHANNEL_CAMERA_NOTIFICATION;
-import static org.openhab.binding.boschshc.internal.devices.BoschSHCBindingConstants.CHANNEL_PRIVACY_MODE;
+import static org.openhab.binding.boschshc.internal.devices.BoschSHCBindingConstants.*;
import java.util.List;
@@ -35,18 +34,18 @@ import org.openhab.core.types.Command;
* Handler for security cameras.
*
* This implementation handles services and commands that are common to all cameras, which are currently:
- *
+ *
*
* PrivacyMode
- Controls whether the camera records images
* CameraNotification
- Enables or disables notifications for the camera
*
- *
+ *
*
* The Eyes outdoor camera advertises a CameraLight
service, which unfortunately does not work properly.
* Valid states are ON
and OFF
.
* One of my two cameras returns HTTP 204 (No Content)
when requesting the state.
* Once Bosch supports this service properly, a new subclass may be introduced for the Eyes outdoor camera.
- *
+ *
* @author David Pace - Initial contribution
*
*/
@@ -77,14 +76,14 @@ public class CameraHandler extends BoschSHCDeviceHandler {
switch (channelUID.getId()) {
case CHANNEL_PRIVACY_MODE:
- if (command instanceof OnOffType) {
- updatePrivacyModeState((OnOffType) command);
+ if (command instanceof OnOffType onOffCommand) {
+ updatePrivacyModeState(onOffCommand);
}
break;
case CHANNEL_CAMERA_NOTIFICATION:
- if (command instanceof OnOffType) {
- updateCameraNotificationState((OnOffType) command);
+ if (command instanceof OnOffType onOffCommand) {
+ updateCameraNotificationState(onOffCommand);
}
break;
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java
index a1875aecc6a..078431ac3aa 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandler.java
@@ -71,31 +71,28 @@ public class ShutterControlHandler extends BoschSHCDeviceHandler {
public void handleCommand(ChannelUID channelUID, Command command) {
super.handleCommand(channelUID, command);
- if (command instanceof UpDownType) {
+ if (command instanceof UpDownType upDownCommand) {
// Set full close/open as target state
- UpDownType upDownType = (UpDownType) command;
ShutterControlServiceState state = new ShutterControlServiceState();
- if (upDownType == UpDownType.UP) {
+ if (upDownCommand == UpDownType.UP) {
state.level = 1.0;
- } else if (upDownType == UpDownType.DOWN) {
+ } else if (upDownCommand == UpDownType.DOWN) {
state.level = 0.0;
} else {
- logger.warn("Received unknown UpDownType command: {}", upDownType);
+ logger.warn("Received unknown UpDownType command: {}", upDownCommand);
return;
}
this.updateServiceState(this.shutterControlService, state);
- } else if (command instanceof StopMoveType) {
- StopMoveType stopMoveType = (StopMoveType) command;
- if (stopMoveType == StopMoveType.STOP) {
+ } else if (command instanceof StopMoveType stopMoveCommand) {
+ if (stopMoveCommand == StopMoveType.STOP) {
// Set STOPPED operation state
ShutterControlServiceState state = new ShutterControlServiceState();
state.operationState = OperationState.STOPPED;
this.updateServiceState(this.shutterControlService, state);
}
- } else if (command instanceof PercentType) {
+ } else if (command instanceof PercentType percentCommand) {
// Set specific level
- PercentType percentType = (PercentType) command;
- double level = DataConversion.openPercentageToLevel(percentType.doubleValue());
+ double level = DataConversion.openPercentageToLevel(percentCommand.doubleValue());
this.updateServiceState(this.shutterControlService, new ShutterControlServiceState(level));
}
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandler.java
index 9dd8a44c601..3a899456309 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandler.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandler.java
@@ -31,6 +31,7 @@ import org.openhab.core.library.types.PercentType;
import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing;
import org.openhab.core.types.Command;
+import org.openhab.core.util.ColorUtil;
/**
* Handler for smart light bulbs connected via Zigbee, e.g. Ledvance Smart+ bulbs
@@ -68,38 +69,38 @@ public class SmartBulbHandler extends BoschSHCDeviceHandler {
switch (channelUID.getId()) {
case CHANNEL_POWER_SWITCH:
- if (command instanceof OnOffType) {
- updateBinarySwitchState((OnOffType) command);
+ if (command instanceof OnOffType onOffCommand) {
+ updateBinarySwitchState(onOffCommand);
}
break;
case CHANNEL_BRIGHTNESS:
- if (command instanceof PercentType) {
- updateMultiLevelSwitchState((PercentType) command);
+ if (command instanceof PercentType percentCommand) {
+ updateMultiLevelSwitchState(percentCommand);
}
break;
case CHANNEL_COLOR:
- if (command instanceof HSBType) {
- updateColorState((HSBType) command);
+ if (command instanceof HSBType hsbCommand) {
+ updateColorState(hsbCommand);
}
break;
}
}
- private void updateBinarySwitchState(OnOffType command) {
+ private void updateBinarySwitchState(OnOffType onOffCommand) {
BinarySwitchServiceState serviceState = new BinarySwitchServiceState();
- serviceState.on = command == OnOffType.ON;
+ serviceState.on = onOffCommand == OnOffType.ON;
this.updateServiceState(binarySwitchService, serviceState);
}
- private void updateMultiLevelSwitchState(PercentType command) {
+ private void updateMultiLevelSwitchState(PercentType percentCommand) {
MultiLevelSwitchServiceState serviceState = new MultiLevelSwitchServiceState();
- serviceState.level = command.intValue();
+ serviceState.level = percentCommand.intValue();
this.updateServiceState(multiLevelSwitchService, serviceState);
}
- private void updateColorState(HSBType command) {
+ private void updateColorState(HSBType hsbCommand) {
HSBColorActuatorServiceState serviceState = new HSBColorActuatorServiceState();
- serviceState.rgb = command.getRGB();
+ serviceState.rgb = ColorUtil.hsbTosRgb(hsbCommand);
this.updateServiceState(hsbColorActuatorService, serviceState);
}
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/batterylevel/BatteryLevel.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/batterylevel/BatteryLevel.java
index a90dd4a0e7c..461791abbcb 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/batterylevel/BatteryLevel.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/batterylevel/BatteryLevel.java
@@ -88,8 +88,7 @@ public enum BatteryLevel {
switch (this) {
case LOW_BATTERY:
return new DecimalType(10);
- case CRITICAL_LOW:
- case CRITICALLY_LOW_BATTERY:
+ case CRITICAL_LOW, CRITICALLY_LOW_BATTERY:
return new DecimalType(1);
case NOT_AVAILABLE:
return UnDefType.UNDEF;
@@ -108,9 +107,7 @@ public enum BatteryLevel {
*/
public OnOffType toLowBatteryState() {
switch (this) {
- case LOW_BATTERY:
- case CRITICAL_LOW:
- case CRITICALLY_LOW_BATTERY:
+ case LOW_BATTERY, CRITICAL_LOW, CRITICALLY_LOW_BATTERY:
return OnOffType.ON;
default:
return OnOffType.OFF;
diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/silentmode/SilentModeState.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/silentmode/SilentModeState.java
index 6a931efff44..4b2637a984b 100644
--- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/silentmode/SilentModeState.java
+++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/services/silentmode/SilentModeState.java
@@ -26,7 +26,7 @@ public enum SilentModeState {
MODE_NORMAL,
MODE_SILENT;
- public static SilentModeState fromOnOffType(OnOffType onOffType) {
- return onOffType == OnOffType.ON ? SilentModeState.MODE_SILENT : SilentModeState.MODE_NORMAL;
+ public static SilentModeState fromOnOffType(OnOffType onOffCommand) {
+ return onOffCommand == OnOffType.ON ? SilentModeState.MODE_SILENT : SilentModeState.MODE_NORMAL;
}
}
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/BoschSHCHandlerFactoryTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/BoschSHCHandlerFactoryTest.java
index 91c097c1ec0..1f679ce2548 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/BoschSHCHandlerFactoryTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/BoschSHCHandlerFactoryTest.java
@@ -29,7 +29,7 @@ import org.openhab.core.thing.ThingTypeUID;
*
*/
@NonNullByDefault
-public class BoschSHCHandlerFactoryTest {
+class BoschSHCHandlerFactoryTest {
private @NonNullByDefault({}) BoschSHCHandlerFactory fixture;
@@ -39,7 +39,7 @@ public class BoschSHCHandlerFactoryTest {
}
@Test
- public void testSupportsThingType() {
+ void testSupportsThingType() {
assertTrue(fixture.supportsThingType(BoschSHCBindingConstants.THING_TYPE_SHC));
assertTrue(fixture.supportsThingType(BoschSHCBindingConstants.THING_TYPE_INWALL_SWITCH));
assertTrue(fixture.supportsThingType(BoschSHCBindingConstants.THING_TYPE_TWINGUARD));
@@ -60,7 +60,7 @@ public class BoschSHCHandlerFactoryTest {
}
@Test
- public void testCreateHandler() {
+ void testCreateHandler() {
Thing thing = mock(Thing.class);
when(thing.getThingTypeUID()).thenReturn(BoschSHCBindingConstants.THING_TYPE_SMART_PLUG_COMPACT);
assertTrue(fixture.createHandler(thing) instanceof PlugHandler);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BridgeConfigurationTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BridgeConfigurationTest.java
index 4a6a8d38f33..cc166c3cae3 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BridgeConfigurationTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/BridgeConfigurationTest.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
*
*/
@NonNullByDefault
-public class BridgeConfigurationTest {
+class BridgeConfigurationTest {
@Test
void testConstructor() {
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/JsonRpcRequestTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/JsonRpcRequestTest.java
index 7d3b43b39b7..57e66cf4221 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/JsonRpcRequestTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/JsonRpcRequestTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
*
*/
@NonNullByDefault
-public class JsonRpcRequestTest {
+class JsonRpcRequestTest {
private @NonNullByDefault({}) JsonRpcRequest fixture;
@@ -35,14 +35,14 @@ public class JsonRpcRequestTest {
}
@Test
- public void testConstructor() {
+ void testConstructor() {
assertEquals("2.0", fixture.getJsonrpc());
assertEquals("RE/longPoll", fixture.getMethod());
assertArrayEquals(new String[] { "subscriptionId", "20" }, fixture.getParams());
}
@Test
- public void testNoArgConstructor() {
+ void testNoArgConstructor() {
fixture = new JsonRpcRequest();
assertEquals("", fixture.getJsonrpc());
assertEquals("", fixture.getMethod());
@@ -50,19 +50,19 @@ public class JsonRpcRequestTest {
}
@Test
- public void testSetJsonrpc() {
+ void testSetJsonrpc() {
fixture.setJsonrpc("test");
assertEquals("test", fixture.getJsonrpc());
}
@Test
- public void testSetMethod() {
+ void testSetMethod() {
fixture.setMethod("RE/subscribe");
assertEquals("RE/subscribe", fixture.getMethod());
}
@Test
- public void testSetParams() {
+ void testSetParams() {
fixture.setParams(new String[] { "com/bosch/sh/remote/*", null });
assertArrayEquals(new String[] { "com/bosch/sh/remote/*", null }, fixture.getParams());
}
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/LongPollingTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/LongPollingTest.java
index 524d23fc111..b6c2dc837a3 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/LongPollingTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/LongPollingTest.java
@@ -62,7 +62,7 @@ import com.google.gson.JsonObject;
*/
@NonNullByDefault
@ExtendWith(MockitoExtension.class)
-public class LongPollingTest {
+class LongPollingTest {
/**
* A dummy implementation of {@link ScheduledFuture}.
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceServiceDataTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceServiceDataTest.java
index cfe653674fe..02180cee81a 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceServiceDataTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceServiceDataTest.java
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
* @author David Pace - Initial contribution
*
*/
-public class DeviceServiceDataTest {
+class DeviceServiceDataTest {
private DeviceServiceData fixture;
@@ -34,7 +34,7 @@ public class DeviceServiceDataTest {
}
@Test
- public void testToString() {
+ void testToString() {
assertEquals("64-da-a0-02-14-9b state: DeviceServiceData", fixture.toString());
}
}
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceTest.java
index 9ee3ac9edf7..125158a749b 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/DeviceTest.java
@@ -60,7 +60,7 @@ public class DeviceTest {
}
@Test
- public void testToString() {
+ void testToString() {
assertEquals(
"Type device; RootDeviceId: 64-da-a0-02-14-9b; Id: hdm:HomeMaticIP:3014F711A00004953859F31B; Device Service Ids: PowerMeter, PowerSwitch, PowerSwitchProgram, Routing; Manufacturer: BOSCH; Room Id: hz_3; Device Model: PSM; Serial: 3014F711A00004953859F31B; Profile: GENERIC; Name: Coffee Machine; Status: AVAILABLE; Child Device Ids: null ",
fixture.toString());
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/LongPollResultTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/LongPollResultTest.java
index 71bc6e3a23d..cb71abfc6f5 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/LongPollResultTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/bridge/dto/LongPollResultTest.java
@@ -24,7 +24,7 @@ import org.openhab.binding.boschshc.internal.serialization.GsonUtils;
* @author Christian Oeing - Initial contribution
*/
@NonNullByDefault
-public class LongPollResultTest {
+class LongPollResultTest {
@Test
void noResultsForErrorResult() {
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandlerTest.java
index b2b79190920..3a9510c60ec 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandlerTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/camera/CameraHandlerTest.java
@@ -44,7 +44,7 @@ import com.google.gson.JsonParser;
*
*/
@NonNullByDefault
-public class CameraHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
+class CameraHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
private @Captor @NonNullByDefault({}) ArgumentCaptor privacyModeServiceStateCaptor;
@@ -66,7 +66,7 @@ public class CameraHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
+class ClimateControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
private @Captor @NonNullByDefault({}) ArgumentCaptor roomClimateControlServiceStateCaptor;
@@ -64,7 +64,7 @@ public class ClimateControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testHandleCommandRoomClimateControlService()
+ void testHandleCommandRoomClimateControlService()
throws InterruptedException, TimeoutException, ExecutionException, BoschSHCException {
QuantityType temperature = new QuantityType<>(21.5, SIUnits.CELSIUS);
getFixture().handleCommand(
@@ -77,7 +77,7 @@ public class ClimateControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testUpdateChannelsTemperatureLevelService() {
+ void testUpdateChannelsTemperatureLevelService() {
JsonElement jsonObject = JsonParser.parseString(
"{\n" + " \"@type\": \"temperatureLevelState\",\n" + " \"temperature\": 21.5\n" + " }");
getFixture().processUpdate("TemperatureLevel", jsonObject);
@@ -87,7 +87,7 @@ public class ClimateControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testUpdateChannelsRoomClimateControlService() {
+ void testUpdateChannelsRoomClimateControlService() {
JsonElement jsonObject = JsonParser.parseString(
"{\n" + " \"@type\": \"climateControlState\",\n" + " \"setpointTemperature\": 21.5\n" + " }");
getFixture().processUpdate("RoomClimateControl", jsonObject);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java
index caf80c43264..3b97c5ac136 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java
@@ -41,7 +41,7 @@ import com.google.gson.JsonParser;
*
*/
@NonNullByDefault
-public class IntrusionDetectionHandlerTest extends AbstractBoschSHCHandlerTest {
+class IntrusionDetectionHandlerTest extends AbstractBoschSHCHandlerTest {
private @Captor @NonNullByDefault({}) ArgumentCaptor armActionRequestCaptor;
@@ -56,7 +56,7 @@ public class IntrusionDetectionHandlerTest extends AbstractBoschSHCHandlerTest {
+class MotionDetectorHandlerTest extends AbstractBatteryPoweredDeviceHandlerTest {
@Override
protected MotionDetectorHandler createFixture() {
@@ -50,7 +50,7 @@ public class MotionDetectorHandlerTest extends AbstractBatteryPoweredDeviceHandl
}
@Test
- public void testUpdateChannelsLatestMotionService() {
+ void testUpdateChannelsLatestMotionService() {
JsonElement jsonObject = JsonParser.parseString("{\n" + " \"@type\": \"latestMotionState\",\n"
+ " \"latestMotionDetected\": \"2020-04-03T19:02:19.054Z\"\n" + " }");
getFixture().processUpdate("LatestMotion", jsonObject);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandlerTest.java
index e3a9a5a0750..614f2524936 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandlerTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/shuttercontrol/ShutterControlHandlerTest.java
@@ -44,7 +44,7 @@ import com.google.gson.JsonParser;
*
*/
@NonNullByDefault
-public class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
+class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
private @Captor @NonNullByDefault({}) ArgumentCaptor shutterControlServiceStateCaptor;
@@ -64,7 +64,7 @@ public class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testHandleCommandUpDownType()
+ void testHandleCommandUpDownType()
throws InterruptedException, TimeoutException, ExecutionException, BoschSHCException {
getFixture().handleCommand(new ChannelUID(getThing().getUID(), BoschSHCBindingConstants.CHANNEL_LEVEL),
UpDownType.UP);
@@ -82,7 +82,7 @@ public class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testHandleCommandStopMoveType()
+ void testHandleCommandStopMoveType()
throws InterruptedException, TimeoutException, ExecutionException, BoschSHCException {
getFixture().handleCommand(new ChannelUID(getThing().getUID(), BoschSHCBindingConstants.CHANNEL_LEVEL),
StopMoveType.STOP);
@@ -93,7 +93,7 @@ public class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testHandleCommandPercentType()
+ void testHandleCommandPercentType()
throws InterruptedException, TimeoutException, ExecutionException, BoschSHCException {
getFixture().handleCommand(new ChannelUID(getThing().getUID(), BoschSHCBindingConstants.CHANNEL_LEVEL),
new PercentType(42));
@@ -104,7 +104,7 @@ public class ShutterControlHandlerTest extends AbstractBoschSHCDeviceHandlerTest
}
@Test
- public void testUpdateChannelsShutterControlService() {
+ void testUpdateChannelsShutterControlService() {
JsonElement jsonObject = JsonParser
.parseString("{\n" + " \"@type\": \"shutterControlState\",\n" + " \"level\": 0.58\n" + " }");
getFixture().processUpdate("ShutterControl", jsonObject);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandlerTest.java
index 9f3fd505800..45dde9f0fe3 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandlerTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/smartbulb/SmartBulbHandlerTest.java
@@ -46,7 +46,7 @@ import com.google.gson.JsonParser;
*
*/
@NonNullByDefault
-public class SmartBulbHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
+class SmartBulbHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
private @Captor @NonNullByDefault({}) ArgumentCaptor binarySwitchServiceStateCaptor;
@@ -70,7 +70,7 @@ public class SmartBulbHandlerTest extends AbstractBoschSHCDeviceHandlerTest {
+class TwinguardHandlerTest extends AbstractSmokeDetectorHandlerTest {
@Override
protected TwinguardHandler createFixture() {
@@ -56,7 +56,7 @@ public class TwinguardHandlerTest extends AbstractSmokeDetectorHandlerTest {
+class WallThermostatHandlerTest extends AbstractBatteryPoweredDeviceHandlerTest {
@Override
protected WallThermostatHandler createFixture() {
@@ -55,7 +55,7 @@ public class WallThermostatHandlerTest extends AbstractBatteryPoweredDeviceHandl
}
@Test
- public void testUpdateChannelsTemperatureLevelService() {
+ void testUpdateChannelsTemperatureLevelService() {
JsonElement jsonObject = JsonParser.parseString(
"{\n" + " \"@type\": \"temperatureLevelState\",\n" + " \"temperature\": 21.5\n" + " }");
getFixture().processUpdate("TemperatureLevel", jsonObject);
@@ -65,7 +65,7 @@ public class WallThermostatHandlerTest extends AbstractBatteryPoweredDeviceHandl
}
@Test
- public void testUpdateChannelsHumidityLevelService() {
+ void testUpdateChannelsHumidityLevelService() {
JsonElement jsonObject = JsonParser
.parseString("{\n" + " \"@type\": \"humidityLevelState\",\n" + " \"humidity\": 42.5\n" + " }");
getFixture().processUpdate("HumidityLevel", jsonObject);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/windowcontact/WindowContactHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/windowcontact/WindowContactHandlerTest.java
index 9c1b3920a10..8ac2960ad4f 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/windowcontact/WindowContactHandlerTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/windowcontact/WindowContactHandlerTest.java
@@ -32,7 +32,7 @@ import com.google.gson.JsonParser;
*
*/
@NonNullByDefault
-public class WindowContactHandlerTest extends AbstractBatteryPoweredDeviceHandlerTest {
+class WindowContactHandlerTest extends AbstractBatteryPoweredDeviceHandlerTest {
@Override
protected WindowContactHandler createFixture() {
@@ -50,7 +50,7 @@ public class WindowContactHandlerTest extends AbstractBatteryPoweredDeviceHandle
}
@Test
- public void testUpdateChannelsShutterContactService() {
+ void testUpdateChannelsShutterContactService() {
JsonElement jsonObject = JsonParser
.parseString("{\n" + " \"@type\": \"shutterContactState\",\n" + " \"value\": \"OPEN\"\n" + " }");
getFixture().processUpdate("ShutterContact", jsonObject);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/BridgeDiscoveryParticipantTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/BridgeDiscoveryParticipantTest.java
index faf441ac518..cc087d02a73 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/BridgeDiscoveryParticipantTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/BridgeDiscoveryParticipantTest.java
@@ -12,9 +12,10 @@
*/
package org.openhab.binding.boschshc.internal.discovery;
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import javax.jmdns.ServiceInfo;
@@ -45,7 +46,7 @@ import org.openhab.core.thing.ThingUID;
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
@NonNullByDefault
-public class BridgeDiscoveryParticipantTest {
+class BridgeDiscoveryParticipantTest {
@Nullable
private BridgeDiscoveryParticipant fixture;
@@ -76,30 +77,30 @@ public class BridgeDiscoveryParticipantTest {
}
/**
- *
+ *
* Method: getSupportedThingTypeUIDs()
- *
+ *
*/
@Test
- public void testGetSupportedThingTypeUIDs() {
+ void testGetSupportedThingTypeUIDs() {
assert fixture != null;
assertTrue(fixture.getSupportedThingTypeUIDs().contains(BoschSHCBindingConstants.THING_TYPE_SHC));
}
/**
- *
+ *
* Method: getServiceType()
- *
+ *
*/
@Test
- public void testGetServiceType() throws Exception {
+ void testGetServiceType() throws Exception {
assert fixture != null;
assertThat(fixture.getServiceType(), is("_http._tcp.local."));
}
@Test
- public void testCreateResult() throws Exception {
+ void testCreateResult() throws Exception {
assert fixture != null;
DiscoveryResult result = fixture.createResult(shcBridge);
assertNotNull(result);
@@ -110,14 +111,14 @@ public class BridgeDiscoveryParticipantTest {
}
@Test
- public void testCreateResultOtherDevice() throws Exception {
+ void testCreateResultOtherDevice() throws Exception {
assert fixture != null;
DiscoveryResult result = fixture.createResult(otherDevice);
assertNull(result);
}
@Test
- public void testGetThingUID() throws Exception {
+ void testGetThingUID() throws Exception {
assert fixture != null;
ThingUID thingUID = fixture.getThingUID(shcBridge);
assertNotNull(thingUID);
@@ -126,32 +127,32 @@ public class BridgeDiscoveryParticipantTest {
}
@Test
- public void testGetThingUIDOtherDevice() throws Exception {
+ void testGetThingUIDOtherDevice() throws Exception {
assert fixture != null;
assertNull(fixture.getThingUID(otherDevice));
}
@Test
- public void testGetBridgeAddress() throws Exception {
+ void testGetBridgeAddress() throws Exception {
assert fixture != null;
assertThat(fixture.discoverBridge(shcBridge).shcIpAddress, is("192.168.0.123"));
}
@Test
- public void testGetBridgeAddressOtherDevice() throws Exception {
+ void testGetBridgeAddressOtherDevice() throws Exception {
assert fixture != null;
assertThat(fixture.discoverBridge(otherDevice).shcIpAddress, is(""));
}
@Test
- public void testGetPublicInformationFromPossibleBridgeAddress() throws Exception {
+ void testGetPublicInformationFromPossibleBridgeAddress() throws Exception {
assert fixture != null;
assertThat(fixture.getPublicInformationFromPossibleBridgeAddress("192.168.0.123").shcIpAddress,
is("192.168.0.123"));
}
@Test
- public void testGetPublicInformationFromPossibleBridgeAddressInvalidContent() throws Exception {
+ void testGetPublicInformationFromPossibleBridgeAddressInvalidContent() throws Exception {
assert fixture != null;
ContentResponse contentResponse = mock(ContentResponse.class);
@@ -170,7 +171,7 @@ public class BridgeDiscoveryParticipantTest {
}
@Test
- public void testGetPublicInformationFromPossibleBridgeAddressInvalidStatus() throws Exception {
+ void testGetPublicInformationFromPossibleBridgeAddressInvalidStatus() throws Exception {
assert fixture != null;
ContentResponse contentResponse = mock(ContentResponse.class);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/ThingDiscoveryServiceTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/ThingDiscoveryServiceTest.java
index 9439144768a..204dbd89ec6 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/ThingDiscoveryServiceTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/discovery/ThingDiscoveryServiceTest.java
@@ -12,9 +12,10 @@
*/
package org.openhab.binding.boschshc.internal.discovery;
-import static org.hamcrest.CoreMatchers.*;
+import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import java.util.ArrayList;
@@ -44,7 +45,7 @@ import org.openhab.core.thing.ThingUID;
*/
@ExtendWith(MockitoExtension.class)
@NonNullByDefault
-public class ThingDiscoveryServiceTest {
+class ThingDiscoveryServiceTest {
private @NonNullByDefault({}) ThingDiscoveryService fixture;
@@ -69,7 +70,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testStartScan() throws InterruptedException {
+ void testStartScan() throws InterruptedException {
mockBridgeCalls();
fixture.activate();
@@ -83,7 +84,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testStartScanWithoutBridgeHandler() {
+ void testStartScanWithoutBridgeHandler() {
mockBridgeCalls();
// No fixture.setThingHandler(bridgeHandler);
@@ -96,13 +97,13 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testSetGetThingHandler() {
+ void testSetGetThingHandler() {
fixture.setThingHandler(bridgeHandler);
assertThat(fixture.getThingHandler(), is(bridgeHandler));
}
@Test
- public void testAddDevices() {
+ void testAddDevices() {
mockBridgeCalls();
ArrayList devices = new ArrayList<>();
@@ -128,7 +129,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testAddDevicesWithNoDevices() {
+ void testAddDevicesWithNoDevices() {
ArrayList emptyDevices = new ArrayList<>();
ArrayList emptyRooms = new ArrayList<>();
@@ -141,7 +142,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testAddDevice() {
+ void testAddDevice() {
mockBridgeCalls();
Device device = new Device();
@@ -159,26 +160,26 @@ public class ThingDiscoveryServiceTest {
assertThat(result.getThingUID().getId(), is("testDevice_ID"));
assertThat(result.getBridgeUID().getId(), is("testSHC"));
assertThat(result.getLabel(), is("Test Name"));
- assertThat(result.getProperties().get("Location").toString(), is("TestRoom"));
+ assertThat(String.valueOf(result.getProperties().get("Location")), is("TestRoom"));
}
@Test
- public void testAddDeviceWithNiceNameAndAppendedRoomName() {
+ void testAddDeviceWithNiceNameAndAppendedRoomName() {
assertDeviceNiceName("-RoomClimateControl-", "TestRoom", "Room Climate Control TestRoom");
}
@Test
- public void testAddDeviceWithNiceNameWithEmtpyRoomName() {
+ void testAddDeviceWithNiceNameWithEmtpyRoomName() {
assertDeviceNiceName("-RoomClimateControl-", "", "Room Climate Control");
}
@Test
- public void testAddDeviceWithNiceNameWithoutAppendingRoomName() {
+ void testAddDeviceWithNiceNameWithoutAppendingRoomName() {
assertDeviceNiceName("-SmokeDetectionSystem-", "TestRoom", "Smoke Detection System");
}
@Test
- public void testAddDeviceWithNiceNameWithoutUsualName() {
+ void testAddDeviceWithNiceNameWithoutUsualName() {
assertDeviceNiceName("My other device", "TestRoom", "My other device");
}
@@ -197,7 +198,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testGetRoomForDevice() {
+ void testGetRoomForDevice() {
Device device = new Device();
ArrayList rooms = new ArrayList<>();
@@ -221,7 +222,7 @@ public class ThingDiscoveryServiceTest {
}
@Test
- public void testGetThingTypeUID() {
+ void testGetThingTypeUID() {
Device device = new Device();
device.deviceModel = "invalid";
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/LongPollingFailedExceptionTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/LongPollingFailedExceptionTest.java
index 7eb58b799e6..fb252f54e9e 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/LongPollingFailedExceptionTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/LongPollingFailedExceptionTest.java
@@ -24,10 +24,10 @@ import org.junit.jupiter.api.Test;
*
*/
@NonNullByDefault
-public class LongPollingFailedExceptionTest {
+class LongPollingFailedExceptionTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
RuntimeException testException = new RuntimeException("test exception");
LongPollingFailedException longPollingFailedException = new LongPollingFailedException("message",
testException);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/PairingFailedExceptionTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/PairingFailedExceptionTest.java
index b9bdfae9ec5..3d9b39a7e2d 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/PairingFailedExceptionTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/exceptions/PairingFailedExceptionTest.java
@@ -24,10 +24,10 @@ import org.junit.jupiter.api.Test;
*
*/
@NonNullByDefault
-public class PairingFailedExceptionTest {
+class PairingFailedExceptionTest {
@Test
- public void testConstructor() {
+ void testConstructor() {
PairingFailedException fixture = new PairingFailedException();
assertNotNull(fixture);
assertNull(fixture.getMessage());
@@ -35,7 +35,7 @@ public class PairingFailedExceptionTest {
}
@Test
- public void testConstructorWithMessage() {
+ void testConstructorWithMessage() {
PairingFailedException fixture = new PairingFailedException("message");
assertNotNull(fixture);
assertEquals("message", fixture.getMessage());
@@ -43,7 +43,7 @@ public class PairingFailedExceptionTest {
}
@Test
- public void testConstructorWithMessageAndCause() {
+ void testConstructorWithMessageAndCause() {
RuntimeException testException = new RuntimeException("test exception");
PairingFailedException fixture = new PairingFailedException("message", testException);
assertNotNull(fixture);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/binaryswitch/dto/BinarySwitchServiceStateTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/binaryswitch/dto/BinarySwitchServiceStateTest.java
index c02b3d5152a..cc1abcd7c13 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/binaryswitch/dto/BinarySwitchServiceStateTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/binaryswitch/dto/BinarySwitchServiceStateTest.java
@@ -23,7 +23,7 @@ import org.openhab.core.library.types.OnOffType;
* @author David Pace - Initial contribution
*
*/
-public class BinarySwitchServiceStateTest {
+class BinarySwitchServiceStateTest {
@Test
void testToOnOffType() {
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/BoschSHCServiceStateTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/BoschSHCServiceStateTest.java
index f0f1a29a5fb..36b5361830d 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/BoschSHCServiceStateTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/BoschSHCServiceStateTest.java
@@ -48,10 +48,10 @@ class TestState2 extends BoschSHCServiceState {
* @author Christian Oeing - Initial contribution
*/
@NonNullByDefault
-public class BoschSHCServiceStateTest {
+class BoschSHCServiceStateTest {
@Test
- public void fromJsonNullStateForDifferentType() {
+ void fromJsonNullStateForDifferentType() {
var state = BoschSHCServiceState.fromJson(
GsonUtils.DEFAULT_GSON_INSTANCE.fromJson("{\"@type\":\"differentState\"}", JsonObject.class),
TestState.class);
@@ -59,7 +59,7 @@ public class BoschSHCServiceStateTest {
}
@Test
- public void fromJsonStateObjectForValidJson() {
+ void fromJsonStateObjectForValidJson() {
var state = BoschSHCServiceState.fromJson(
GsonUtils.DEFAULT_GSON_INSTANCE.fromJson("{\"@type\":\"testState\"}", JsonObject.class),
TestState.class);
@@ -70,7 +70,7 @@ public class BoschSHCServiceStateTest {
* This checks for a bug we had where the expected type stayed the same for different state classes
*/
@Test
- public void fromJsonStateObjectForValidJsonAfterOtherState() {
+ void fromJsonStateObjectForValidJsonAfterOtherState() {
BoschSHCServiceState.fromJson(
GsonUtils.DEFAULT_GSON_INSTANCE.fromJson("{\"@type\":\"testState\"}", JsonObject.class),
TestState.class);
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/JsonRestExceptionResponseTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/JsonRestExceptionResponseTest.java
index 86e485acbde..adcccb06ef6 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/JsonRestExceptionResponseTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/dto/JsonRestExceptionResponseTest.java
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
*
*/
@NonNullByDefault
-public class JsonRestExceptionResponseTest {
+class JsonRestExceptionResponseTest {
private @NonNullByDefault({}) JsonRestExceptionResponse fixture;
@@ -35,7 +35,7 @@ public class JsonRestExceptionResponseTest {
}
@Test
- public void testIsValid() {
+ void testIsValid() {
assertFalse(JsonRestExceptionResponse.isValid(null));
assertTrue(JsonRestExceptionResponse.isValid(fixture));
fixture.errorCode = null;
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/hsbcoloractuator/dto/HSBColorActuatorServiceStateTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/hsbcoloractuator/dto/HSBColorActuatorServiceStateTest.java
index 440b117ec84..faebb1d1a66 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/hsbcoloractuator/dto/HSBColorActuatorServiceStateTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/hsbcoloractuator/dto/HSBColorActuatorServiceStateTest.java
@@ -23,7 +23,7 @@ import org.openhab.core.library.types.HSBType;
* @author David Pace - Initial contribution
*
*/
-public class HSBColorActuatorServiceStateTest {
+class HSBColorActuatorServiceStateTest {
@Test
void testToHSBType() {
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/multilevelswitch/dto/MultiLevelSwitchServiceStateTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/multilevelswitch/dto/MultiLevelSwitchServiceStateTest.java
index f3cee17a99f..d5c31a448e7 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/multilevelswitch/dto/MultiLevelSwitchServiceStateTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/multilevelswitch/dto/MultiLevelSwitchServiceStateTest.java
@@ -23,7 +23,7 @@ import org.openhab.core.library.types.PercentType;
* @author David Pace - Initial contribution
*
*/
-public class MultiLevelSwitchServiceStateTest {
+class MultiLevelSwitchServiceStateTest {
@Test
void testToPercentType() {
diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/smokedetectorcheck/SmokeDetectorCheckStateTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/smokedetectorcheck/SmokeDetectorCheckStateTest.java
index 0d36219099f..2e28456aa8a 100644
--- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/smokedetectorcheck/SmokeDetectorCheckStateTest.java
+++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/services/smokedetectorcheck/SmokeDetectorCheckStateTest.java
@@ -19,12 +19,12 @@ import org.junit.jupiter.api.Test;
/**
* Unit tests for {@link SmokeDetectorCheckState}.
- *
+ *
* @author David Pace - Initial contribution
*
*/
@NonNullByDefault
-public class SmokeDetectorCheckStateTest {
+class SmokeDetectorCheckStateTest {
@Test
void testFrom() {