From 34c03f11457b951451fb802dd6a0c0c59092bc49 Mon Sep 17 00:00:00 2001 From: dernasherbrezon Date: Fri, 16 Aug 2024 10:48:55 +0200 Subject: [PATCH] fix unit test --- src/main/java/ru/r2cloud/model/DeviceConfiguration.java | 2 +- src/test/resources/r2cloudclienttest/1559982858904-59114-0.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/r2cloud/model/DeviceConfiguration.java b/src/main/java/ru/r2cloud/model/DeviceConfiguration.java index 6b5838ea..7ff05477 100644 --- a/src/main/java/ru/r2cloud/model/DeviceConfiguration.java +++ b/src/main/java/ru/r2cloud/model/DeviceConfiguration.java @@ -254,7 +254,7 @@ public static DeviceConfiguration fromJson(JsonObject meta) { result.setUsername(meta.getString("username", null)); result.setGain(meta.getFloat("gain", 0)); JsonValue rtlDeviceId = meta.get("rtlDeviceId"); - if (rtlDeviceId == null) { + if (rtlDeviceId == null || rtlDeviceId.isNull()) { result.setRtlDeviceId("0"); } else { if (rtlDeviceId.isNumber()) { diff --git a/src/test/resources/r2cloudclienttest/1559982858904-59114-0.json b/src/test/resources/r2cloudclienttest/1559982858904-59114-0.json index 01e61552..0dfacab3 100644 --- a/src/test/resources/r2cloudclienttest/1559982858904-59114-0.json +++ b/src/test/resources/r2cloudclienttest/1559982858904-59114-0.json @@ -25,7 +25,7 @@ "maximumFrequency": 480000000, "host": "7b:7a:24:3c:ed:50", "gain": 0, - "rtlDeviceId": 0, + "rtlDeviceId": "0", "biast": false, "ppm": 0, "antenna": {