Skip to content

Commit

Permalink
Bump up dependencies versions (#32)
Browse files Browse the repository at this point in the history
- Bump up dependencies versions
- apply changes of cloudevents
  • Loading branch information
chanhyeong authored Aug 19, 2024
1 parent ce5aba7 commit a4b10f1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion buildSrc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
springBootVersion=3.2.1
springBootVersion=3.3.2
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@

package com.navercorp.eventeria.messaging.jackson.header;

import io.cloudevents.core.format.ContentType;
import io.cloudevents.core.provider.EventFormatProvider;
import io.cloudevents.jackson.JsonFormat;

import com.navercorp.eventeria.messaging.header.DefaultCloudEventHeaderMapper;

/**
* A extended implementation to configure 'content-type' header as {@link JsonFormat#CONTENT_TYPE}
* A extended implementation to configure 'content-type' header as {@link ContentType#JSON}
*/
public class JacksonCloudEventHeaderMapper extends DefaultCloudEventHeaderMapper {
public JacksonCloudEventHeaderMapper() {
super(EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE));
super(EventFormatProvider.getInstance().resolveFormat(ContentType.JSON));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@

package com.navercorp.eventeria.messaging.jackson.serializer;

import io.cloudevents.core.format.ContentType;
import io.cloudevents.core.provider.EventFormatProvider;
import io.cloudevents.jackson.JsonFormat;

import com.navercorp.eventeria.messaging.serializer.DefaultCloudEventSerializer;

/**
* A implementation of serializer/deserializer between {@link io.cloudevents.CloudEvent} and byte array<br/>
* using {@link JsonFormat}.
* using {@link ContentType#JSON}.
*/
public final class JacksonCloudEventSerializer extends DefaultCloudEventSerializer {
public JacksonCloudEventSerializer() {
super(EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE));
super(EventFormatProvider.getInstance().resolveFormat(ContentType.JSON));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
import net.jqwik.api.domains.Domain;

import io.cloudevents.CloudEvent;
import io.cloudevents.core.format.ContentType;
import io.cloudevents.core.message.Encoding;
import io.cloudevents.core.provider.EventFormatProvider;
import io.cloudevents.jackson.JsonFormat;
import io.cloudevents.kafka.CloudEventDeserializer;
import io.cloudevents.kafka.CloudEventSerializer;
import kafka.server.KafkaConfig;
Expand Down Expand Up @@ -108,7 +108,7 @@ void configs(@ForAll TestDomainEvent testDomainEvent) throws ExecutionException,
producerProps.put(CloudEventSerializer.ENCODING_CONFIG, Encoding.STRUCTURED);
producerProps.put(
CloudEventSerializer.EVENT_FORMAT_CONFIG,
EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE)
EventFormatProvider.getInstance().resolveFormat(ContentType.JSON)
);

try (KafkaProducer<String, CloudEvent> producer = new KafkaProducer<>(producerProps)) {
Expand All @@ -131,7 +131,7 @@ void configs(@ForAll TestDomainEvent testDomainEvent) throws ExecutionException,

records.forEach(rec -> {
rec.headers().headers("content-type").iterator().forEachRemaining(it ->
assertThat(new String(it.value(), StandardCharsets.UTF_8)).isEqualTo(JsonFormat.CONTENT_TYPE)
assertThat(new String(it.value(), StandardCharsets.UTF_8)).isEqualTo(ContentType.JSON.value())
);

Message message = cloudEventToMessageConverter.convert(rec.value());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.springframework.util.MimeTypeUtils;

import io.cloudevents.CloudEvent;
import io.cloudevents.core.format.ContentType;

import com.navercorp.eventeria.messaging.contract.cloudevents.serializer.CloudEventSerializerDeserializer;

Expand All @@ -41,7 +42,7 @@ public class SpringCloudEventMessageConverter extends AbstractMessageConverter {
public SpringCloudEventMessageConverter(CloudEventSerializerDeserializer cloudEventSerializerDeserializer) {
super(
Arrays.asList(
new MimeType("application", "cloudevents+json"),
MimeType.valueOf(ContentType.JSON.value()),
MimeTypeUtils.APPLICATION_JSON
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import io.cloudevents.CloudEvent;
import io.cloudevents.SpecVersion;
import io.cloudevents.core.format.ContentType;
import io.cloudevents.core.provider.EventFormatProvider;
import io.cloudevents.core.v1.CloudEventV1;
import io.cloudevents.jackson.JsonCloudEventData;
import io.cloudevents.jackson.JsonFormat;

import com.navercorp.eventeria.messaging.contract.Message;
import com.navercorp.eventeria.messaging.contract.cloudevents.converter.CloudEventToMessageConverter;
Expand All @@ -52,7 +52,7 @@

class DefaultCloudEventSerializerTest {
private final DefaultCloudEventSerializer sut = new DefaultCloudEventSerializer(
EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE)
EventFormatProvider.getInstance().resolveFormat(ContentType.JSON)
);
private final JacksonMessageSerializer messageSerializer = new JacksonMessageSerializer();
private MessageToCloudEventConverter messageToCloudEventConverter;
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jqwikVersion=1.7.0
springCloudVersion=2023.0.2
cloudEventVersion=2.5.0
springCloudVersion=2023.0.3
cloudEventVersion=4.0.1

0 comments on commit a4b10f1

Please sign in to comment.