Resolve itest runbundles for Gson and Commons Lang upgrades and fix JsonParser deprecations (#10345)

* Resolve itest runbundles for Gson and Commons Lang upgrades
* Fix JsonParser deprecations too
* Fix feature verification

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-03-18 12:15:15 +01:00
committed by GitHub
parent 009208adee
commit 580f293766
86 changed files with 206 additions and 215 deletions

View File

@@ -844,7 +844,7 @@ public class HueBridge {
return super.doNetwork(address, requestMethod, body);
} else {
String extractedAddress = Util.quickMatch("^http://[^/]+(.+)$", address);
JsonElement commandBody = new JsonParser().parse(body);
JsonElement commandBody = body == null ? null : JsonParser.parseString(body);
scheduleCommand = new ScheduleCommand(extractedAddress, requestMethod, commandBody);
// Return a fake result that will cause an exception and the callback to end

View File

@@ -425,9 +425,8 @@ public class HueLightHandlerTest {
}
private void assertJson(String expected, String actual) {
JsonParser parser = new JsonParser();
JsonElement jsonExpected = parser.parse(expected);
JsonElement jsonActual = parser.parse(actual);
JsonElement jsonExpected = JsonParser.parseString(expected);
JsonElement jsonActual = JsonParser.parseString(actual);
assertEquals(jsonExpected, jsonActual);
}
}