From 40e2abbfdb65beee88f1789211a4c8628b65c5ab Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:19:10 +0300 Subject: [PATCH 01/15] add matchers-json dependency, replace org.eclipse.parsson:parsson with org.glassfish:jakarta.json --- pom.xml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index f5fc115..82b591b 100644 --- a/pom.xml +++ b/pom.xml @@ -23,20 +23,20 @@ 17 + + wtf.g4s8 + matchers-json + 1.0-SNAPSHOT + com.github.ArtemGet teleroute.telegrambots 1.0.1 - jakarta.json - jakarta.json-api - 2.1.3 - - - org.eclipse.parsson - parsson - 1.1.7 + org.glassfish + jakarta.json + 1.1.6 org.jdbi @@ -66,11 +66,6 @@ 5.10.2 test - - org.hamcrest - hamcrest-all - 1.3 - src @@ -234,13 +229,7 @@ dependencies:org.takes:takes:jar:1.24.6:compile - dependencies:org.hamcrest:hamcrest:jar:2.2:test - - - dependencies:org.hamcrest:hamcrest-all:jar:1.3:compile - - - dependencies:org.eclipse.parsson:parsson:jar:1.1.7:compile + dependencies:org.hamcrest:hamcrest:jar:2.2:compile dependencies:org.cactoos:cactoos:jar:0.56.1:compile From 35265adbff5c8f0dedd6324d316e4a66fcfcf160 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:19:33 +0300 Subject: [PATCH 02/15] remove JsonValueIs --- .../artemget/prbot/bot/match/JsonValueIs.java | 174 ------------------ 1 file changed, 174 deletions(-) delete mode 100644 src/io/github/artemget/prbot/bot/match/JsonValueIs.java diff --git a/src/io/github/artemget/prbot/bot/match/JsonValueIs.java b/src/io/github/artemget/prbot/bot/match/JsonValueIs.java deleted file mode 100644 index 89cfeb8..0000000 --- a/src/io/github/artemget/prbot/bot/match/JsonValueIs.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2024-2025. Artem Getmanskii - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package io.github.artemget.prbot.bot.match; - -import jakarta.json.JsonValue; -import java.util.Locale; -import org.hamcrest.CoreMatchers; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -/** - * Matches json values. - * - * @since 0.1 - */ -@SuppressWarnings("PMD.AvoidDuplicateLiterals") -public final class JsonValueIs extends TypeSafeMatcher { - - /** - * Matcher for json-null. - */ - public static final TypeSafeMatcher NULL = - new JsonValueIs( - CoreMatchers.equalTo(JsonValue.ValueType.NULL), - CoreMatchers.any(String.class) - ); - - /** - * Json type. - */ - private final Matcher type; - - /** - * Json value matcher. - */ - private final Matcher value; - - /** - * Ctor for boolean. - * - * @param bool Boolean value - */ - public JsonValueIs(final boolean bool) { - this( - CoreMatchers.equalTo( - JsonValue.ValueType.valueOf(Boolean.toString(bool) - .toUpperCase(Locale.US) - ) - ), - CoreMatchers.equalTo(Boolean.toString(bool)) - ); - } - - /** - * Ctor for number. - * - * @param number Expected number - */ - public JsonValueIs(final Number number) { - this( - CoreMatchers.equalTo(JsonValue.ValueType.NUMBER), - CoreMatchers.equalTo(number.toString()) - ); - } - - /** - * Ctor for string. - * - * @param value Expected value - */ - public JsonValueIs(final String value) { - this( - CoreMatchers.equalTo(JsonValue.ValueType.STRING), - CoreMatchers.equalTo(value) - ); - } - - /** - * Ctor for string. - * - * @param value Json value. - */ - public JsonValueIs(final Matcher value) { - this(CoreMatchers.equalTo(JsonValue.ValueType.STRING), value); - } - - /** - * Ctor. - * - * @param type Value type - * @param matcher Value matcher - */ - public JsonValueIs(final JsonValue.ValueType type, - final Matcher matcher) { - this(CoreMatchers.equalTo(type), matcher); - } - - /** - * Ctor. - * - * @param type Json type. - * @param value Json value. - */ - public JsonValueIs(final Matcher type, - final Matcher value) { - super(); - this.type = type; - this.value = value; - } - - @Override - public void describeTo(final Description desc) { - desc.appendText("value ") - .appendDescriptionOf(this.value) - .appendText(" of type ") - .appendDescriptionOf(this.type); - } - - @Override - public boolean matchesSafely(final JsonValue item) { - return item != null - && this.type.matches(item.getValueType()) - && this.value.matches(JsonValueIs.escaped(item)); - } - - @Override - public void describeMismatchSafely(final JsonValue item, - final Description desc) { - desc.appendText("value ") - .appendValue(JsonValueIs.escaped(item)) - .appendText(" of type ") - .appendValue(item.getValueType()); - } - - /** - * Escaped string. - * - * @param value Json value - * @return Escaped string - */ - private static String escaped(final JsonValue value) { - final String esc; - final String src = value.toString(); - if (value.getValueType().equals(JsonValue.ValueType.STRING)) { - esc = src.substring(1).substring(0, src.length() - 2); - } else { - esc = src; - } - return esc; - } -} From 68ac3a657decf868234e50a92b4b17781aaa64f5 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:19:44 +0300 Subject: [PATCH 03/15] remove StringIsJson --- .../prbot/bot/match/StringIsJson.java | 140 ------------------ 1 file changed, 140 deletions(-) delete mode 100644 src/io/github/artemget/prbot/bot/match/StringIsJson.java diff --git a/src/io/github/artemget/prbot/bot/match/StringIsJson.java b/src/io/github/artemget/prbot/bot/match/StringIsJson.java deleted file mode 100644 index a571f93..0000000 --- a/src/io/github/artemget/prbot/bot/match/StringIsJson.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2024-2025. Artem Getmanskii - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package io.github.artemget.prbot.bot.match; - -import jakarta.json.Json; -import jakarta.json.JsonArray; -import jakarta.json.JsonObject; -import jakarta.json.JsonReader; -import jakarta.json.JsonValue; -import jakarta.json.stream.JsonParsingException; -import java.io.StringReader; -import java.util.function.Function; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -/** - * Match a string against json matcher. - * - * @since 0.2 - */ -@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass") -public abstract class StringIsJson extends TypeSafeMatcher { - - /** - * Json matcher. - */ - private final Matcher matcher; - - /** - * Parsing of json. - */ - private final Function parsing; - - /** - * Ctor. - * - * @param matcher Json matcher - * @param parsing Json parsing - */ - private StringIsJson( - final Matcher matcher, - final Function parsing - ) { - super(); - this.matcher = matcher; - this.parsing = parsing; - } - - @Override - public void describeTo(final Description description) { - description.appendText("string ") - .appendDescriptionOf(this.matcher); - } - - @Override - public void describeMismatchSafely( - final String item, - final Description description - ) { - description.appendText("string: '") - .appendValue(item) - .appendText("' "); - try { - this.matcher.describeMismatch( - this.parsing.apply(Json.createReader(new StringReader(item))), - description - ); - } catch (final JsonParsingException err) { - description.appendText("is not a valid json: ") - .appendText(err.getMessage()); - } - } - - @Override - public boolean matchesSafely(final String item) { - boolean success; - try { - success = this.matcher.matches( - this.parsing.apply(Json.createReader(new StringReader(item))) - ); - } catch (final JsonParsingException ignored) { - success = false; - } - return success; - } - - /** - * Json object as string. - * @since 0.2 - */ - public static final class Object extends StringIsJson { - - /** - * String is JSON object. - * - * @param matcher Object matcher - */ - public Object(final Matcher matcher) { - super(matcher, JsonReader::readObject); - } - } - - /** - * Json array as string. - * @since 0.2 - */ - public static final class Array extends StringIsJson { - - /** - * String is JSON array. - * @param matcher Array matcher - */ - public Array(final Matcher matcher) { - super(matcher, JsonReader::readArray); - } - } -} From 9dce7e3f7a9cf557a33d9972a12fec91d7f35b90 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:19:55 +0300 Subject: [PATCH 04/15] remove JsonHas --- .../artemget/prbot/bot/match/JsonHas.java | 117 ------------------ 1 file changed, 117 deletions(-) delete mode 100644 src/io/github/artemget/prbot/bot/match/JsonHas.java diff --git a/src/io/github/artemget/prbot/bot/match/JsonHas.java b/src/io/github/artemget/prbot/bot/match/JsonHas.java deleted file mode 100644 index dcf7fa3..0000000 --- a/src/io/github/artemget/prbot/bot/match/JsonHas.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2024-2025. Artem Getmanskii - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package io.github.artemget.prbot.bot.match; - -import jakarta.json.JsonObject; -import jakarta.json.JsonValue; -import org.hamcrest.Description; -import org.hamcrest.Matcher; -import org.hamcrest.TypeSafeMatcher; - -/** - * Matches json object fields. - * - * @since 0.1 - * @todo #20:15 remove {@link JsonHas}, - * {@link io.github.artemget.prbot.bot.match.JsonValueIs} - * and {@link io.github.artemget.prbot.bot.match.StringIsJson} from this project when - * matchers-json jakarta issue - * would be closed. Add matchers-json dependency and fix used imports through the project. - */ -@SuppressWarnings("PMD.AvoidDuplicateLiterals") -public final class JsonHas extends TypeSafeMatcher { - - /** - * Field name. - */ - private final String field; - - /** - * Value matcher. - */ - private final Matcher matcher; - - /** - * JSON has a string value for field. - * @param field Name - * @param value Expected string - */ - public JsonHas(final String field, final String value) { - this(field, new JsonValueIs(value)); - } - - /** - * JSON has a number value for field. - * @param field Name - * @param value Expected string - */ - public JsonHas(final String field, final Number value) { - this(field, new JsonValueIs(value)); - } - - /** - * JSON has a boolean value for field. - * @param field Name - * @param value Expected string - */ - public JsonHas(final String field, final boolean value) { - this(field, new JsonValueIs(value)); - } - - /** - * Ctor. - * - * @param field Field name - * @param matcher Value matcher - */ - public JsonHas(final String field, - final Matcher matcher) { - super(); - this.field = field; - this.matcher = matcher; - } - - @Override - public void describeTo(final Description description) { - description.appendText("field ") - .appendValue(this.field) - .appendText(" with ") - .appendDescriptionOf(this.matcher); - } - - @Override - public boolean matchesSafely(final JsonObject item) { - return this.matcher.matches(item.get(this.field)); - } - - @Override - public void describeMismatchSafely(final JsonObject item, - final Description desc) { - desc.appendText("field ") - .appendValue(this.field) - .appendText(" "); - this.matcher.describeMismatch(item.get(this.field), desc); - } -} From 6a63af9eb9aae8ae5a44be90a89acffed90860c0 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:20:18 +0300 Subject: [PATCH 05/15] fix imports AccJson --- src/io/github/artemget/prbot/domain/pr/AccJson.java | 2 +- test/io/github/artemget/prbot/domain/pr/AccJsonTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/github/artemget/prbot/domain/pr/AccJson.java b/src/io/github/artemget/prbot/domain/pr/AccJson.java index 703bf59..4d0a77d 100644 --- a/src/io/github/artemget/prbot/domain/pr/AccJson.java +++ b/src/io/github/artemget/prbot/domain/pr/AccJson.java @@ -26,7 +26,7 @@ import io.github.artemget.prbot.config.EJsonStr; import io.github.artemget.prbot.config.EntryException; -import jakarta.json.JsonObject; +import javax.json.JsonObject; /** * User's account from json source. diff --git a/test/io/github/artemget/prbot/domain/pr/AccJsonTest.java b/test/io/github/artemget/prbot/domain/pr/AccJsonTest.java index 2dfdc86..32019da 100644 --- a/test/io/github/artemget/prbot/domain/pr/AccJsonTest.java +++ b/test/io/github/artemget/prbot/domain/pr/AccJsonTest.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.domain.pr; -import jakarta.json.Json; +import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; From e7e04e87dec2c1be37f130d8722d7f6f3df05a01 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:20:27 +0300 Subject: [PATCH 06/15] fix imports BrJson --- src/io/github/artemget/prbot/domain/pr/BrJson.java | 2 +- test/io/github/artemget/prbot/domain/pr/BrJsonTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/github/artemget/prbot/domain/pr/BrJson.java b/src/io/github/artemget/prbot/domain/pr/BrJson.java index bb6991a..12f38fc 100644 --- a/src/io/github/artemget/prbot/domain/pr/BrJson.java +++ b/src/io/github/artemget/prbot/domain/pr/BrJson.java @@ -26,7 +26,7 @@ import io.github.artemget.prbot.config.EJsonStr; import io.github.artemget.prbot.config.EntryException; -import jakarta.json.JsonObject; +import javax.json.JsonObject; /** * Git branch from json source. diff --git a/test/io/github/artemget/prbot/domain/pr/BrJsonTest.java b/test/io/github/artemget/prbot/domain/pr/BrJsonTest.java index a9be908..293ab84 100644 --- a/test/io/github/artemget/prbot/domain/pr/BrJsonTest.java +++ b/test/io/github/artemget/prbot/domain/pr/BrJsonTest.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.domain.pr; -import jakarta.json.Json; +import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; From 7b5b06fc03aef940700b2bcbfaacebdbdb46971f Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:20:36 +0300 Subject: [PATCH 07/15] fix imports EJsonArr --- src/io/github/artemget/prbot/config/EJsonArr.java | 4 ++-- test/io/github/artemget/prbot/config/EJsonArrTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/io/github/artemget/prbot/config/EJsonArr.java b/src/io/github/artemget/prbot/config/EJsonArr.java index 01b4c5c..894e8d2 100644 --- a/src/io/github/artemget/prbot/config/EJsonArr.java +++ b/src/io/github/artemget/prbot/config/EJsonArr.java @@ -24,8 +24,8 @@ package io.github.artemget.prbot.config; -import jakarta.json.JsonArray; -import jakarta.json.JsonObject; +import javax.json.JsonArray; +import javax.json.JsonObject; import org.cactoos.Scalar; /** diff --git a/test/io/github/artemget/prbot/config/EJsonArrTest.java b/test/io/github/artemget/prbot/config/EJsonArrTest.java index 042b280..3fc7f49 100644 --- a/test/io/github/artemget/prbot/config/EJsonArrTest.java +++ b/test/io/github/artemget/prbot/config/EJsonArrTest.java @@ -1,7 +1,7 @@ package io.github.artemget.prbot.config; -import jakarta.json.Json; -import jakarta.json.JsonObject; +import javax.json.Json; +import javax.json.JsonObject; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; From 582fd109e1914d6d1639c2370e0287ee80da7690 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:20:43 +0300 Subject: [PATCH 08/15] fix imports EJsonObj --- src/io/github/artemget/prbot/config/EJsonObj.java | 2 +- test/io/github/artemget/prbot/config/EJsonObjTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io/github/artemget/prbot/config/EJsonObj.java b/src/io/github/artemget/prbot/config/EJsonObj.java index 11158f3..fa322a5 100644 --- a/src/io/github/artemget/prbot/config/EJsonObj.java +++ b/src/io/github/artemget/prbot/config/EJsonObj.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.config; -import jakarta.json.JsonObject; +import javax.json.JsonObject; import org.cactoos.Scalar; /** diff --git a/test/io/github/artemget/prbot/config/EJsonObjTest.java b/test/io/github/artemget/prbot/config/EJsonObjTest.java index ca3f962..f547735 100644 --- a/test/io/github/artemget/prbot/config/EJsonObjTest.java +++ b/test/io/github/artemget/prbot/config/EJsonObjTest.java @@ -24,8 +24,8 @@ package io.github.artemget.prbot.config; -import jakarta.json.Json; -import jakarta.json.JsonObject; +import javax.json.Json; +import javax.json.JsonObject; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; From 62b735fe470852e18920f88a8b6d0fd4c94d903d Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:20:52 +0300 Subject: [PATCH 09/15] fix imports EJsonStr --- src/io/github/artemget/prbot/config/EJsonStr.java | 2 +- test/io/github/artemget/prbot/config/EJsonStrTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/github/artemget/prbot/config/EJsonStr.java b/src/io/github/artemget/prbot/config/EJsonStr.java index f77544f..60f63ed 100644 --- a/src/io/github/artemget/prbot/config/EJsonStr.java +++ b/src/io/github/artemget/prbot/config/EJsonStr.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.config; -import jakarta.json.JsonObject; +import javax.json.JsonObject; import org.cactoos.Scalar; /** diff --git a/test/io/github/artemget/prbot/config/EJsonStrTest.java b/test/io/github/artemget/prbot/config/EJsonStrTest.java index 80ac9a7..77c70e4 100644 --- a/test/io/github/artemget/prbot/config/EJsonStrTest.java +++ b/test/io/github/artemget/prbot/config/EJsonStrTest.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.config; -import jakarta.json.Json; +import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; From 666e70a3afdee30f5aabb0ff65d61f7b996b2e9f Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:21:09 +0300 Subject: [PATCH 10/15] fix imports MatchJsonVal --- src/io/github/artemget/prbot/bot/match/MatchJsonVal.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/io/github/artemget/prbot/bot/match/MatchJsonVal.java b/src/io/github/artemget/prbot/bot/match/MatchJsonVal.java index 66ecd0f..1c1975c 100644 --- a/src/io/github/artemget/prbot/bot/match/MatchJsonVal.java +++ b/src/io/github/artemget/prbot/bot/match/MatchJsonVal.java @@ -28,6 +28,8 @@ import java.util.function.Predicate; import org.hamcrest.TypeSafeMatcher; import org.telegram.telegrambots.meta.api.objects.Update; +import wtf.g4s8.hamcrest.json.JsonHas; +import wtf.g4s8.hamcrest.json.StringIsJson; /** * Wraps {@link MatchJson}. From abd4d47b1392f814dc659aacaffe185c7a640416 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:21:24 +0300 Subject: [PATCH 11/15] fix imports PrJsonStrict --- src/io/github/artemget/prbot/domain/pr/PrJsonStrict.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/io/github/artemget/prbot/domain/pr/PrJsonStrict.java b/src/io/github/artemget/prbot/domain/pr/PrJsonStrict.java index ce31f2d..0fe1f9f 100644 --- a/src/io/github/artemget/prbot/domain/pr/PrJsonStrict.java +++ b/src/io/github/artemget/prbot/domain/pr/PrJsonStrict.java @@ -28,13 +28,13 @@ import io.github.artemget.prbot.config.EJsonObj; import io.github.artemget.prbot.config.EJsonStr; import io.github.artemget.prbot.config.EntryException; -import jakarta.json.Json; -import jakarta.json.JsonArray; -import jakarta.json.JsonObject; -import jakarta.json.JsonReader; import java.io.StringReader; import java.util.List; import java.util.stream.Collectors; +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonObject; +import javax.json.JsonReader; /** * Pull request from source strict json. From 4b9c04ccd494583b89ab51aa8c650201af68238f Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:21:39 +0300 Subject: [PATCH 12/15] fix imports ProjJson --- src/io/github/artemget/prbot/domain/pr/ProjJson.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/io/github/artemget/prbot/domain/pr/ProjJson.java b/src/io/github/artemget/prbot/domain/pr/ProjJson.java index 36cc92d..4e5f97a 100644 --- a/src/io/github/artemget/prbot/domain/pr/ProjJson.java +++ b/src/io/github/artemget/prbot/domain/pr/ProjJson.java @@ -24,7 +24,7 @@ package io.github.artemget.prbot.domain.pr; -import jakarta.json.JsonObject; +import javax.json.JsonObject; /** * Git project from json source. From 83ce96a1fb24f448c749aa7ec84db7511a7c24e3 Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:21:50 +0300 Subject: [PATCH 13/15] fix imports ReqHkGitlab --- src/io/github/artemget/prbot/domain/pr/ReqHkGitlab.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/io/github/artemget/prbot/domain/pr/ReqHkGitlab.java b/src/io/github/artemget/prbot/domain/pr/ReqHkGitlab.java index 8ee9f2f..4fee15e 100644 --- a/src/io/github/artemget/prbot/domain/pr/ReqHkGitlab.java +++ b/src/io/github/artemget/prbot/domain/pr/ReqHkGitlab.java @@ -26,10 +26,10 @@ import io.github.artemget.prbot.config.EJsonObj; import io.github.artemget.prbot.config.EntryException; -import jakarta.json.Json; -import jakarta.json.JsonObject; -import jakarta.json.JsonReader; import java.io.StringReader; +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonReader; /** * Gitlab webhook request. From 335981947abed5408ab82e34648cb81b798aaa9c Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:22:01 +0300 Subject: [PATCH 14/15] fix imports RouteHkGitlab --- src/io/github/artemget/prbot/bot/route/RouteHkGitlab.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/github/artemget/prbot/bot/route/RouteHkGitlab.java b/src/io/github/artemget/prbot/bot/route/RouteHkGitlab.java index 71f7379..fa69521 100644 --- a/src/io/github/artemget/prbot/bot/route/RouteHkGitlab.java +++ b/src/io/github/artemget/prbot/bot/route/RouteHkGitlab.java @@ -29,9 +29,7 @@ import io.github.artemget.prbot.bot.command.CmdPrMerge; import io.github.artemget.prbot.bot.command.CmdPrOpen; import io.github.artemget.prbot.bot.command.CmdPrReject; -import io.github.artemget.prbot.bot.match.JsonHas; import io.github.artemget.prbot.bot.match.MatchJsonVal; -import io.github.artemget.prbot.bot.match.StringIsJson; import io.github.artemget.prbot.config.EProp; import io.github.artemget.prbot.config.Entry; import io.github.artemget.prbot.config.EntryException; @@ -41,6 +39,8 @@ import io.github.artemget.teleroute.route.RouteFork; import org.telegram.telegrambots.meta.api.objects.Update; import org.telegram.telegrambots.meta.bots.AbsSender; +import wtf.g4s8.hamcrest.json.JsonHas; +import wtf.g4s8.hamcrest.json.StringIsJson; /** * Routes for gitlab merge request webhook. From 30fcda39ab99f3acf4c528f583b6cb7e62a602fe Mon Sep 17 00:00:00 2001 From: Artem Getmanskii Date: Thu, 13 Mar 2025 14:37:24 +0300 Subject: [PATCH 15/15] pull matchers-json via jitpack --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 82b591b..e53e4ef 100644 --- a/pom.xml +++ b/pom.xml @@ -24,9 +24,9 @@ - wtf.g4s8 + com.github.g4s8 matchers-json - 1.0-SNAPSHOT + 4f82cfafa1 com.github.ArtemGet