Skip to content

Commit

Permalink
Upgrade avro-version to 1.12.0 to match camel
Browse files Browse the repository at this point in the history
  • Loading branch information
cunningt committed Sep 19, 2024
1 parent 6abe3c7 commit 64d8af1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.fasterxml.jackson.dataformat.avro.AvroSchema;

import org.apache.avro.NameValidator;
import org.apache.avro.Schema;
import org.apache.camel.EndpointInject;
import org.apache.camel.ProducerTemplate;
Expand Down Expand Up @@ -57,7 +58,7 @@ public class JacksonAvroLookupResolverTest {
private SchemaResolver getSchemaResolver() {
String schemaJson = "{\n" + "\"type\": \"record\",\n" + "\"name\": \"Pojo\",\n" + "\"fields\": [\n"
+ " {\"name\": \"text\", \"type\": \"string\"}\n" + "]}";
Schema raw = new Schema.Parser().setValidate(true).parse(schemaJson);
Schema raw = new Schema.Parser(NameValidator.STRICT_VALIDATOR).parse(schemaJson);
AvroSchema schema = new AvroSchema(raw);
SchemaResolver resolver = ex -> schema;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.dataformat.avro.AvroSchema;

import org.apache.avro.NameValidator;
import org.apache.avro.Schema;
import org.apache.camel.CamelContext;
import org.apache.camel.EndpointInject;
Expand Down Expand Up @@ -70,10 +71,10 @@ private SchemaResolver getSchemaResolver() {
+ " \"type\":\"record\",\n" + " \"fields\":[\n"
+ " {\"name\":\"text\", \"type\":\"string\"}\n" + " ]\n" + " }\n" + "}";

Schema raw = new Schema.Parser().setValidate(true).parse(schemaJson);
Schema raw = new Schema.Parser(NameValidator.STRICT_VALIDATOR).parse(schemaJson);
AvroSchema schema = new AvroSchema(raw);

Schema rawList = new Schema.Parser().setValidate(true).parse(listSchemaJson);
Schema rawList = new Schema.Parser(NameValidator.STRICT_VALIDATOR).parse(listSchemaJson);
AvroSchema schemaList = new AvroSchema(rawList);

SchemaResolver resolver = ex -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.fasterxml.jackson.dataformat.avro.AvroSchema;

import org.apache.avro.NameValidator;
import org.apache.avro.Schema;
import org.apache.camel.EndpointInject;
import org.apache.camel.ProducerTemplate;
Expand Down Expand Up @@ -62,7 +63,7 @@ private SchemaResolver getSchemaResolver() {
String schemaJson = "{\n" + " \"type\": \"array\", \n" + " \"items\":{\n" + " \"name\":\"Pojo\",\n"
+ " \"type\":\"record\",\n" + " \"fields\":[\n"
+ " {\"name\":\"text\", \"type\":\"string\"}\n" + " ]\n" + " }\n" + "}";
Schema raw = new Schema.Parser().setValidate(true).parse(schemaJson);
Schema raw = new Schema.Parser(NameValidator.STRICT_VALIDATOR).parse(schemaJson);
AvroSchema schema = new AvroSchema(raw);
SchemaResolver resolver = ex -> schema;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.fasterxml.jackson.dataformat.avro.AvroSchema;

import org.apache.avro.NameValidator;
import org.apache.avro.Schema;
import org.apache.camel.EndpointInject;
import org.apache.camel.ProducerTemplate;
Expand Down Expand Up @@ -57,7 +58,7 @@ public class JacksonAvroMarshalUnmarshalPojoTest {
private SchemaResolver getSchemaResolver() {
String schemaJson = "{\n" + "\"type\": \"record\",\n" + "\"name\": \"Pojo\",\n" + "\"fields\": [\n"
+ " {\"name\": \"text\", \"type\": \"string\"}\n" + "]}";
Schema raw = new Schema.Parser().setValidate(true).parse(schemaJson);
Schema raw = new Schema.Parser(NameValidator.STRICT_VALIDATOR).parse(schemaJson);
AvroSchema schema = new AvroSchema(raw);
SchemaResolver resolver = ex -> schema;

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 @@
<aether-version>1.0.2.v20150114</aether-version>
<arquillian-container-se-managed-version>1.0.2.Final</arquillian-container-se-managed-version>
<arquillian-version>1.7.0.Alpha10</arquillian-version>
<avro-version>1.11.0</avro-version>
<avro-version>1.12.0</avro-version>
<groovy-version>4.0.13</groovy-version>
<graal-sdk-version>22.3.2</graal-sdk-version>
<jakarta-jaxb-version>4.0.0</jakarta-jaxb-version>
Expand Down
8 changes: 4 additions & 4 deletions tooling/camel-spring-boot-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,22 @@
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-ipc</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-mapred</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-protobuf</artifactId>
<version>1.11.0</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel.maven</groupId>
Expand Down

0 comments on commit 64d8af1

Please sign in to comment.