Java 17 features (itests) (#15583)

- replace Collections by List.of and Set.of
- instanceof
- SAT warnings

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-09-13 08:06:37 +02:00
committed by GitHub
parent ab58f4ffb4
commit b3e88ae29e
15 changed files with 45 additions and 49 deletions

View File

@@ -385,9 +385,15 @@ public class RuuviGatewayTest extends MqttOSGiTest {
} else {
// test argument is only specifiying the data field in the json payload
// Fill rest of the fields with some valid values
jsonPayload = "{" + " \"gw_mac\": \"DE:AD:BE:EF:00\"," + " \"rssi\": -82," + " \"aoa\": [],"
+ " \"gwts\": \"1659365432\"," + " \"ts\": \"1659365222\"," + " \"data\": \"" + val + "\","
+ " \"coords\": \"\" }";
jsonPayload = """
{\
"gw_mac": "DE:AD:BE:EF:00",\
"rssi": -82,\
"aoa": [],\
"gwts": "1659365432",\
"ts": "1659365222",\
"data": "\
""" + val + "\"," + " \"coords\": \"\" }";
}
Thing ruuviThing = createRuuviThing("mygwid", topic, 100);
@@ -525,7 +531,6 @@ public class RuuviGatewayTest extends MqttOSGiTest {
.forEach(channelId -> assertEquals(UnDefType.UNDEF, getItemState.apply(channelId)));
statusUpdateIndex.incrementAndGet();
});
}
// Another mqtt update (("minimum values" test vector from

View File

@@ -14,7 +14,6 @@ package org.openhab.binding.mqtt.ruuvigateway;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -48,7 +47,7 @@ public class ThingStatusInfoChangedSubscriber implements EventSubscriber {
@Override
public Set<@NonNull String> getSubscribedEventTypes() {
return Collections.singleton(ThingStatusInfoChangedEvent.TYPE);
return Set.of(ThingStatusInfoChangedEvent.TYPE);
}
@Override