From 4443731c8d4222f5341d1540f92cf86a9c2e9f8b Mon Sep 17 00:00:00 2001 From: Matthew Skinner Date: Tue, 30 Jul 2024 20:49:10 +1000 Subject: [PATCH] Fix dependancy issues. (#17159) Signed-off-by: Matthew Skinner Signed-off-by: Ciprian Pascu --- bundles/org.openhab.binding.dbquery/pom.xml | 74 +++++++++++++------ .../resources/OH-INF/thing/influx2-bridge.xml | 2 +- .../internal/Value2StateConverterTest.java | 4 +- .../domain/QueryResultJSONEncoderTest.java | 12 ++- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/bundles/org.openhab.binding.dbquery/pom.xml b/bundles/org.openhab.binding.dbquery/pom.xml index 9bc5af4c930..74a42427c08 100644 --- a/bundles/org.openhab.binding.dbquery/pom.xml +++ b/bundles/org.openhab.binding.dbquery/pom.xml @@ -18,6 +18,9 @@ !javax.annotation;!android.*,!com.android.*,!com.google.appengine.*,!dalvik.system,!kotlin.*,!kotlinx.*,!org.conscrypt,!sun.security.ssl,!org.apache.harmony.*,!org.apache.http.*,!rx.*,!org.msgpack.*,!org.bouncycastle.*,!org.openjsse.* + 7.0.0 + 3.1.8 + 2.10.0 @@ -25,28 +28,60 @@ com.influxdb influxdb-client-java - 1.6.0 + ${influx2.version} influxdb-client-core com.influxdb - 1.6.0 + ${influx2.version} + com.influxdb + influxdb-client-utils + ${influx2.version} + + + com.influxdb + flux-dsl + ${influx2.version} + + + com.influxdb + influxdb-client-flux + ${influx2.version} + + + + com.squareup.retrofit2 converter-gson - com.squareup.retrofit2 - 2.5.0 + ${retrofit.version} - converter-scalars com.squareup.retrofit2 - 2.5.0 + converter-scalars + ${retrofit.version} + + retrofit + com.squareup.retrofit2 + ${retrofit.version} + + + com.squareup.retrofit2 + adapter-rxjava3 + ${retrofit.version} + + gson com.google.code.gson ${gson.version} + + com.google.code.findbugs + jsr305 + 3.0.2 + gson-fire io.gsonfire @@ -67,7 +102,7 @@ commons-csv org.apache.commons - 1.6 + 1.10.0 json @@ -79,35 +114,30 @@ com.squareup.okhttp3 ${okhttp3.version} - - retrofit - com.squareup.retrofit2 - 2.6.2 - - - jsr305 - com.google.code.findbugs - 3.0.2 - logging-interceptor com.squareup.okhttp3 ${okhttp3.version} + io.reactivex.rxjava3 rxjava - io.reactivex.rxjava2 - 2.2.17 + ${io.reactivex.rxjava3} reactive-streams org.reactivestreams - 1.0.3 + 1.0.4 + io.swagger.core.v3 swagger-annotations - io.swagger - 1.5.22 + 2.2.22 + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} diff --git a/bundles/org.openhab.binding.dbquery/src/main/resources/OH-INF/thing/influx2-bridge.xml b/bundles/org.openhab.binding.dbquery/src/main/resources/OH-INF/thing/influx2-bridge.xml index bb41a79e606..ee344aa2abc 100644 --- a/bundles/org.openhab.binding.dbquery/src/main/resources/OH-INF/thing/influx2-bridge.xml +++ b/bundles/org.openhab.binding.dbquery/src/main/resources/OH-INF/thing/influx2-bridge.xml @@ -12,7 +12,7 @@ url Database url - http://localhost:9999 + http://localhost:8086 diff --git a/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/Value2StateConverterTest.java b/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/Value2StateConverterTest.java index b8961586b39..8604f5ccd92 100644 --- a/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/Value2StateConverterTest.java +++ b/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/Value2StateConverterTest.java @@ -12,9 +12,7 @@ */ package org.openhab.binding.dbquery.internal; -import static org.hamcrest.CoreMatchers.anyOf; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.number.IsCloseTo.closeTo; diff --git a/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/domain/QueryResultJSONEncoderTest.java b/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/domain/QueryResultJSONEncoderTest.java index 30d900a3161..138e372db4b 100644 --- a/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/domain/QueryResultJSONEncoderTest.java +++ b/bundles/org.openhab.binding.dbquery/src/test/java/org/openhab/binding/dbquery/internal/domain/QueryResultJSONEncoderTest.java @@ -14,10 +14,8 @@ package org.openhab.binding.dbquery.internal.domain; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.closeTo; -import static org.hamcrest.Matchers.lessThan; +import static org.hamcrest.Matchers.*; import java.time.Duration; import java.time.Instant; @@ -34,6 +32,7 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; import com.google.gson.Gson; +import com.google.gson.JsonObject; import com.google.gson.JsonParser; /** @@ -45,13 +44,12 @@ class QueryResultJSONEncoderTest { public static final double TOLERANCE = 0.001d; private final DBQueryJSONEncoder instance = new DBQueryJSONEncoder(); private final Gson gson = new Gson(); - private final JsonParser jsonParser = new JsonParser(); @Test void givenQueryResultIsSerializedToJson() { - String json = instance.encode(givenQueryResultWithResults()); - - assertThat(jsonParser.parse(json), notNullValue()); + JsonObject jsonObjectAlt = JsonParser.parseString(instance.encode(givenQueryResultWithResults())) + .getAsJsonObject(); + assertThat(jsonObjectAlt.isJsonNull(), org.hamcrest.CoreMatchers.is(false)); } @Test