projects
/
demos
/
kafka
/
chat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TMP:test -- `ChatRoomDataTest`
[demos/kafka/chat]
/
src
/
test
/
java
/
de
/
juplo
/
kafka
/
chat
/
backend
/
domain
/
ChatHomeServiceTest.java
diff --git
a/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeServiceTest.java
b/src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeServiceTest.java
index
004c35f
..
3be9a35
100644
(file)
--- a/
src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeServiceTest.java
+++ b/
src/test/java/de/juplo/kafka/chat/backend/domain/ChatHomeServiceTest.java
@@
-1,9
+1,12
@@
package de.juplo.kafka.chat.backend.domain;
package de.juplo.kafka.chat.backend.domain;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import de.juplo.kafka.chat.backend.ChatBackendProperties;
import de.juplo.kafka.chat.backend.ChatBackendProperties;
-import de.juplo.kafka.chat.backend.
domain.exceptions.LoadInProgress
Exception;
+import de.juplo.kafka.chat.backend.
implementation.kafka.ChannelNotReady
Exception;
import de.juplo.kafka.chat.backend.domain.exceptions.UnknownChatroomException;
import de.juplo.kafka.chat.backend.implementation.inmemory.InMemoryServicesConfiguration;
import de.juplo.kafka.chat.backend.domain.exceptions.UnknownChatroomException;
import de.juplo.kafka.chat.backend.implementation.inmemory.InMemoryServicesConfiguration;
+import de.juplo.kafka.chat.backend.implementation.kafka.KafkaServicesConfiguration;
import de.juplo.kafka.chat.backend.storage.files.FilesStorageConfiguration;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import de.juplo.kafka.chat.backend.storage.files.FilesStorageConfiguration;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@
-24,6
+27,7
@@
import static pl.rzrz.assertj.reactor.Assertions.assertThat;
@SpringJUnitConfig(classes = {
InMemoryServicesConfiguration.class,
FilesStorageConfiguration.class,
@SpringJUnitConfig(classes = {
InMemoryServicesConfiguration.class,
FilesStorageConfiguration.class,
+ KafkaServicesConfiguration.class,
ChatHomeServiceTest.TestConfiguration.class })
@EnableConfigurationProperties(ChatBackendProperties.class)
public abstract class ChatHomeServiceTest
ChatHomeServiceTest.TestConfiguration.class })
@EnableConfigurationProperties(ChatBackendProperties.class)
public abstract class ChatHomeServiceTest
@@
-45,7
+49,7
@@
public abstract class ChatHomeServiceTest
.log("testGetExistingChatroom")
.retryWhen(Retry
.backoff(5, Duration.ofSeconds(1))
.log("testGetExistingChatroom")
.retryWhen(Retry
.backoff(5, Duration.ofSeconds(1))
- .filter(throwable -> throwable instanceof
LoadInProgress
Exception));
+ .filter(throwable -> throwable instanceof
ChannelNotReady
Exception));
// Then
assertThat(mono).emitsCount(1);
// Then
assertThat(mono).emitsCount(1);
@@
-64,7
+68,7
@@
public abstract class ChatHomeServiceTest
.log("testGetNonExistentChatroom")
.retryWhen(Retry
.backoff(5, Duration.ofSeconds(1))
.log("testGetNonExistentChatroom")
.retryWhen(Retry
.backoff(5, Duration.ofSeconds(1))
- .filter(throwable -> throwable instanceof
LoadInProgress
Exception));
+ .filter(throwable -> throwable instanceof
ChannelNotReady
Exception));
// Then
assertThat(mono).sendsError(e ->
// Then
assertThat(mono).sendsError(e ->
@@
-77,6
+81,14
@@
public abstract class ChatHomeServiceTest
static class TestConfiguration
{
static class TestConfiguration
{
+ @Bean
+ ObjectMapper objectMapper()
+ {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.registerModule(new JavaTimeModule());
+ return objectMapper;
+ }
+
@Bean
Clock clock()
{
@Bean
Clock clock()
{