diff --git a/CHANGELOG.md b/CHANGELOG.md index f9884f8c..ddf15d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +### Dependencies +- Updated dependencies: + + Compile: + * Bump jsonschema2pojo version from 1.2.2 to 1.3.3 + ### Bug fixes - Remove the root-level `logback.xml` from the `tarantool-core` runtime JAR. diff --git a/pom.xml b/pom.xml index b3944f2f..1df8009c 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,6 @@ ${project.parent.basedir}/tarantool-shared-resources/ ${project.basedir}/LICENSE_HEADER.txt 3.5.5 - 1.2.2 diff --git a/tarantool-java-sdk-bom/pom.xml b/tarantool-java-sdk-bom/pom.xml index be7246fd..6391fc73 100644 --- a/tarantool-java-sdk-bom/pom.xml +++ b/tarantool-java-sdk-bom/pom.xml @@ -32,7 +32,7 @@ 1.22.0 2.21.0 5.5.1 - 1.2.2 + 1.3.3 1.62.0 @@ -205,6 +205,12 @@ ${jsonschema2pojo.version} + + org.jsonschema2pojo + jsonschema2pojo-maven-plugin + ${jsonschema2pojo.version} + + ch.qos.logback diff --git a/testcontainers-autogen/pom.xml b/testcontainers-autogen/pom.xml index a110dc44..4d78ed4b 100644 --- a/testcontainers-autogen/pom.xml +++ b/testcontainers-autogen/pom.xml @@ -25,7 +25,6 @@ org.jsonschema2pojo jsonschema2pojo-core - ${jsonschema2pojo.version} diff --git a/testcontainers-autogen/src/main/java/io/tarantool/SeparatedPackageObjectRule.java b/testcontainers-autogen/src/main/java/io/tarantool/SeparatedPackageObjectRule.java index f51eba40..0097a4a2 100644 --- a/testcontainers-autogen/src/main/java/io/tarantool/SeparatedPackageObjectRule.java +++ b/testcontainers-autogen/src/main/java/io/tarantool/SeparatedPackageObjectRule.java @@ -12,11 +12,6 @@ import java.util.Map; import java.util.Set; -import static org.apache.commons.lang.StringUtils.substringAfter; -import static org.apache.commons.lang.StringUtils.substringBefore; -import static org.jsonschema2pojo.rules.PrimitiveTypes.isPrimitive; -import static org.jsonschema2pojo.rules.PrimitiveTypes.primitiveType; -import static org.jsonschema2pojo.util.TypeUtil.resolveType; import com.fasterxml.jackson.databind.JsonNode; import com.sun.codemodel.ClassType; import com.sun.codemodel.JBlock; @@ -34,18 +29,21 @@ import com.sun.codemodel.JPackage; import com.sun.codemodel.JType; import com.sun.codemodel.JVar; +import org.apache.commons.lang3.StringUtils; import org.jsonschema2pojo.AnnotationStyle; import org.jsonschema2pojo.Annotator; import org.jsonschema2pojo.Schema; import org.jsonschema2pojo.exception.ClassAlreadyExistsException; import org.jsonschema2pojo.exception.GenerationException; import org.jsonschema2pojo.rules.ObjectRule; +import org.jsonschema2pojo.rules.PrimitiveTypes; import org.jsonschema2pojo.rules.Rule; import org.jsonschema2pojo.rules.RuleFactory; import org.jsonschema2pojo.util.AnnotationHelper; import org.jsonschema2pojo.util.ParcelableHelper; import org.jsonschema2pojo.util.ReflectionHelper; import org.jsonschema2pojo.util.SerializableHelper; +import org.jsonschema2pojo.util.TypeUtil; public class SeparatedPackageObjectRule extends ObjectRule { @@ -194,18 +192,20 @@ private JDefinedClass createClass(String nodeName, JsonNode node, JPackage _pack try { if (node.has("existingJavaType")) { - String fqn = substringBefore(node.get("existingJavaType").asText(), "<"); + String fqn = StringUtils.substringBefore(node.get("existingJavaType").asText(), "<"); - if (isPrimitive(fqn, _package.owner())) { - throw new ClassAlreadyExistsException(primitiveType(fqn, _package.owner())); + if (PrimitiveTypes.isPrimitive(fqn, _package.owner())) { + throw new ClassAlreadyExistsException( + PrimitiveTypes.primitiveType(fqn, _package.owner())); } JClass existingClass = - resolveType( + TypeUtil.resolveType( _package, fqn + (node.get("existingJavaType").asText().contains("<") - ? "<" + substringAfter(node.get("existingJavaType").asText(), "<") + ? "<" + + StringUtils.substringAfter(node.get("existingJavaType").asText(), "<") : "")); throw new ClassAlreadyExistsException(existingClass); } @@ -215,7 +215,7 @@ private JDefinedClass createClass(String nodeName, JsonNode node, JPackage _pack if (node.has("javaType")) { String fqn = node.path("javaType").asText(); - if (isPrimitive(fqn, _package.owner())) { + if (PrimitiveTypes.isPrimitive(fqn, _package.owner())) { throw new GenerationException( "javaType cannot refer to a primitive type (" + fqn @@ -590,7 +590,7 @@ private void addEquals(JDefinedClass jclass, JsonNode node) { private void addInterfaces(JDefinedClass jclass, JsonNode javaInterfaces) { for (JsonNode i : javaInterfaces) { - jclass._implements(resolveType(jclass._package(), i.asText())); + jclass._implements(TypeUtil.resolveType(jclass._package(), i.asText())); } } diff --git a/testcontainers/pom.xml b/testcontainers/pom.xml index ef86938b..e6cd35fe 100644 --- a/testcontainers/pom.xml +++ b/testcontainers/pom.xml @@ -108,7 +108,6 @@ org.jsonschema2pojo jsonschema2pojo-maven-plugin - ${jsonschema2pojo.version} ${basedir}/src/main/resources/tarantool io.tarantool.autogen diff --git a/testcontainers/src/main/java/org/testcontainers/containers/utils/TarantoolContainerClientHelper.java b/testcontainers/src/main/java/org/testcontainers/containers/utils/TarantoolContainerClientHelper.java index 4883efbb..0ce6dd2d 100644 --- a/testcontainers/src/main/java/org/testcontainers/containers/utils/TarantoolContainerClientHelper.java +++ b/testcontainers/src/main/java/org/testcontainers/containers/utils/TarantoolContainerClientHelper.java @@ -37,8 +37,6 @@ import io.tarantool.autogen.Tarantool3Configuration; import io.tarantool.autogen.credentials.Credentials; -import io.tarantool.autogen.credentials.roles.rolesProperty.privilege.Permission; -import io.tarantool.autogen.credentials.roles.rolesProperty.privilege.Privilege; import io.tarantool.autogen.credentials.users.Users; import io.tarantool.autogen.credentials.users.usersProperty.UsersProperty; import io.tarantool.autogen.groups.Groups; @@ -293,13 +291,41 @@ private static Path createConfig(String containerName, Integer... exposedPorts) .withPassword("secret_a") .withPrivileges( List.of( - Privilege.builder() + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Privilege + .builder() .withPermissions( new LinkedHashSet<>( List.of( - Permission.READ, - Permission.WRITE, - Permission.EXECUTE))) + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .READ, + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .WRITE, + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .EXECUTE))) .build())) .build()) .withAdditionalProperty( @@ -308,13 +334,41 @@ private static Path createConfig(String containerName, Integer... exposedPorts) .withPassword("secret_b") .withPrivileges( List.of( - Privilege.builder() + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Privilege + .builder() .withPermissions( new LinkedHashSet<>( List.of( - Permission.READ, - Permission.WRITE, - Permission.EXECUTE))) + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .READ, + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .WRITE, + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .EXECUTE))) .build())) .build()) .withAdditionalProperty( @@ -325,10 +379,25 @@ private static Path createConfig(String containerName, Integer... exposedPorts) .withPassword("secret_d") .withPrivileges( Collections.singletonList( - Privilege.builder() + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Privilege + .builder() .withPermissions( new LinkedHashSet<>( - Collections.singletonList(Permission.EXECUTE))) + Collections.singletonList( + io.tarantool + .autogen + .credentials + .users + .usersProperty + .privilege + .Permission + .EXECUTE))) .build())) .build()) .withAdditionalProperty(