Skip to content

Commit

Permalink
Fix XStream serializer issue in KafkaPublisher
Browse files Browse the repository at this point in the history
Fix missed XStreamSerializer issue due to the Axon Framework 4.5.5 update
  • Loading branch information
martink76 committed Dec 10, 2021
1 parent 7ca21a0 commit 52964a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ public static class Builder<K, V> {
@SuppressWarnings("unchecked")
private KafkaMessageConverter<K, V> messageConverter =
(KafkaMessageConverter<K, V>) DefaultKafkaMessageConverter.builder()
.serializer(XStreamSerializer.builder()
.build())
.serializer(XStreamSerializer.defaultSerializer())
.build();
private MessageMonitor<? super EventMessage<?>> messageMonitor = NoOpMessageMonitor.instance();
private String topic = DEFAULT_TOPIC;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.axonframework.extensions.kafka.eventhandling.producer;

import org.junit.jupiter.api.*;
import org.junit.jupiter.api.extension.*;
import org.mockito.*;
import org.mockito.junit.jupiter.*;

import static org.junit.jupiter.api.Assertions.*;

@ExtendWith(MockitoExtension.class)
class KafkaPublisherBuilderTest {

@Mock
private ProducerFactory<String, byte[]> producerFactory;

@Test
void testKafkaPublisherInitialisationShouldNotThrowException() {
assertDoesNotThrow(() -> KafkaPublisher.<String, byte[]>builder()
.producerFactory(producerFactory)
.build());
}
}

0 comments on commit 52964a8

Please sign in to comment.