Skip to content

Commit

Permalink
fix(deps): fix upgrade to jackson 2.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Jan 23, 2025
1 parent 3361f43 commit fa4d646
Show file tree
Hide file tree
Showing 32 changed files with 187 additions and 450 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import io.streamthoughts.jikkou.core.models.change.ResourceChange;
import java.beans.ConstructorProperties;
import java.time.Instant;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.streamthoughts.jikkou.core.io.Jackson;
import io.streamthoughts.jikkou.core.reconciler.Operation;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) The original authors
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.streamthoughts.jikkou.core.models.generics;

import com.fasterxml.jackson.core.JsonProcessingException;
import io.streamthoughts.jikkou.core.io.Jackson;
import io.streamthoughts.jikkou.core.models.ObjectMeta;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class GenericResourceTest {

@Test
void shouldDeserializeAnyValue() throws JsonProcessingException {
// Given
String yaml = """
apiVersion: io.jikkou/v1
kind: Test
metadata:
name: "test"
spec:
field1: value1
field2: value2
""";

// When
GenericResource deserialized = Jackson.YAML_OBJECT_MAPPER.readValue(yaml, GenericResource.class);

// Then
GenericResource expected = new GenericResource(
"io.jikkou/v1",
"Test",
ObjectMeta
.builder()
.withName("test")
.build(),
null,
Map.of("spec", Map.of("field1", "value1", "field2", "value2"))
);

Assertions.assertEquals(expected, deserialized);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright (c) The original authors
*
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.streamthoughts.jikkou.core.reconciler;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<!-- Dependencies -->
<kafka.version>3.7.0</kafka.version>
<picocli.version>4.7.6</picocli.version>
<jackson.version>2.18.0</jackson.version>
<jackson.version>2.18.2</jackson.version>
<jinjava.version>2.7.2</jinjava.version>
<lombok.version>1.18.32</lombok.version>
<config.version>1.4.3</config.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -21,18 +21,11 @@
* @param message Printable result of the request
*/
@Reflectable
public record CompatibilityCheckResponse(boolean isCompatible,
@Nullable List<Error> errors,
@Nullable String message
public record CompatibilityCheckResponse(@JsonProperty("is_compatible") boolean isCompatible,
@JsonProperty("errors") @Nullable List<Error> errors,
@JsonProperty("message") @Nullable String message
) {

@ConstructorProperties({
"is_compatible",
"errors",
"message",
})
public CompatibilityCheckResponse {}

/**
* {@inheritDoc}
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;

/**
* Represents an error occurred during request processing.
Expand All @@ -18,13 +18,9 @@
* @param errorCode Machine-readable error_code
*/
@Reflectable
public record Error(String message, String moreInfo, int status, String errorCode) {

@ConstructorProperties({
"message",
"more_info",
"status",
"error_code"
})
public Error {}
public record Error(
@JsonProperty("message") String message,
@JsonProperty("more_info") String moreInfo,
@JsonProperty("status") int status,
@JsonProperty("error_code") String errorCode) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Objects;

/**
Expand All @@ -32,17 +31,6 @@ public record KafkaAclEntry(@JsonProperty("permission") String permission,
@JsonProperty("username") String username,
@JsonProperty("id") String id) {

/**
* Creates a new {@link KafkaAclEntry} instance.
*/
@ConstructorProperties({
"permission",
"topic",
"username",
"id"
})
public KafkaAclEntry {
}

/**
* Creates a new {@link KafkaAclEntry} instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -22,15 +22,10 @@
* @param message Printable result of the request.
*/
@Reflectable
public record ListKafkaAclResponse(List<KafkaAclEntry> acl, List<Error> errors, String message) {

@ConstructorProperties({
"acl",
"errors",
"message"
})
public ListKafkaAclResponse {
}
public record ListKafkaAclResponse(
@JsonProperty("acl") List<KafkaAclEntry> acl,
@JsonProperty("errors") List<Error> errors,
@JsonProperty("message") String message) {

@Override
public List<Error> errors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -22,15 +22,10 @@
* @param message Printable result of the request.
*/
@Reflectable
public record ListKafkaQuotaResponse(List<KafkaQuotaEntry> quotas, List<Error> errors, String message) {

@ConstructorProperties({
"quotas",
"errors",
"message"
})
public ListKafkaQuotaResponse {
}
public record ListKafkaQuotaResponse(
@JsonProperty("quotas") List<KafkaQuotaEntry> quotas,
@JsonProperty("errors") List<Error> errors,
@JsonProperty("message") String message) {

@Override
public List<Error> errors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -22,15 +22,10 @@
* @param message Printable result of the request
*/
@Reflectable
public record ListSchemaRegistryAclResponse(List<SchemaRegistryAclEntry> acl, List<Error> errors, String message) {

@ConstructorProperties({
"acl",
"errors",
"message"
})
public ListSchemaRegistryAclResponse {
}
public record ListSchemaRegistryAclResponse(
@JsonProperty("acl") List<SchemaRegistryAclEntry> acl,
@JsonProperty("errors") List<Error> errors,
@JsonProperty("message") String message) {

@Override
public List<Error> errors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.List;

/**
Expand All @@ -18,14 +18,9 @@
* @param errors the errors.
*/
@Reflectable
public record MessageErrorsResponse(String message, List<Error> errors) {

@ConstructorProperties({
"message",
"errors"
})
public MessageErrorsResponse {
}
public record MessageErrorsResponse(
@JsonProperty("message") String message,
@JsonProperty("errors") List<Error> errors) {

/**
* Represents a single error.
Expand All @@ -34,15 +29,10 @@ public record MessageErrorsResponse(String message, List<Error> errors) {
* @param status HTTP error status name
* @param errorCode Machine-readable error_code
*/
public record Error(String message, int status, String errorCode) {

@ConstructorProperties({
"message",
"status",
"error_code"
})
public Error {
}
public record Error(
@JsonProperty("message") String message,
@JsonProperty("status") int status,
@JsonProperty("error_code") String errorCode) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand All @@ -21,15 +21,10 @@
* @param message Printable result of the request
*/
@Reflectable
public record ServiceInformationResponse(Map<String, Object> service, List<Error> errors, String message) {

@ConstructorProperties({
"service",
"errors",
"message",
})
public ServiceInformationResponse {
}
public record ServiceInformationResponse(
@JsonProperty("service") Map<String, Object> service,
@JsonProperty("errors") List<Error> errors,
@JsonProperty("message") String message) {

@Override
public List<Error> errors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/
package io.streamthoughts.jikkou.extension.aiven.api.data;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.jikkou.core.annotation.Reflectable;
import io.streamthoughts.jikkou.schema.registry.model.CompatibilityLevels;
import java.beans.ConstructorProperties;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -22,19 +22,11 @@
* @param message Printable result of the request
*/
@Reflectable
public record SubjectSchemaConfigurationResponse(CompatibilityLevels compatibilityLevel,
@Nullable List<Error> errors,
@Nullable String message
public record SubjectSchemaConfigurationResponse(@JsonProperty("compatibilityLevel") CompatibilityLevels compatibilityLevel,
@JsonProperty("errors") @Nullable List<Error> errors,
@JsonProperty("message") @Nullable String message
) {

@ConstructorProperties({
"compatibilityLevel",
"errors",
"message",
})
public SubjectSchemaConfigurationResponse {
}

/**
* {@inheritDoc}
**/
Expand Down
Loading

0 comments on commit fa4d646

Please sign in to comment.