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

@@ -120,7 +120,7 @@ public class TibberHandler extends BaseThingHandler {
String jsonResponse = HttpUtil.executeUrl("POST", BASE_URL, httpHeader, inputStream, null,
REQUEST_TIMEOUT);
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
rtEnabled = object.getAsJsonObject("data").getAsJsonObject("viewer").getAsJsonObject("home")
.getAsJsonObject("features").get("realTimeConsumptionEnabled").toString();
@@ -152,7 +152,7 @@ public class TibberHandler extends BaseThingHandler {
updateStatus(ThingStatus.ONLINE);
}
JsonObject object = (JsonObject) new JsonParser().parse(jsonResponse);
JsonObject object = (JsonObject) JsonParser.parseString(jsonResponse);
if (jsonResponse.contains("total")) {
try {
@@ -434,7 +434,7 @@ public class TibberHandler extends BaseThingHandler {
logger.debug("Error/terminate received from server: {}", message);
close();
} else if (message.contains("liveMeasurement")) {
JsonObject object = (JsonObject) new JsonParser().parse(message);
JsonObject object = (JsonObject) JsonParser.parseString(message);
JsonObject myObject = object.getAsJsonObject("payload").getAsJsonObject("data")
.getAsJsonObject("liveMeasurement");
if (myObject.has("timestamp")) {