1 package de.juplo.kafka.chat.backend.persistence.kafka.messages;
3 import com.fasterxml.jackson.databind.ObjectMapper;
4 import com.fasterxml.jackson.databind.SerializationFeature;
5 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
6 import org.junit.jupiter.api.BeforeEach;
7 import org.junit.jupiter.api.Test;
9 import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
12 public class CommandCreateChatRoomToTest
14 final String json = """
24 mapper = new ObjectMapper();
25 mapper.registerModule(new JavaTimeModule());
26 mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
30 public void testDeserialization() throws Exception
32 CommandCreateChatRoomTo message = mapper.readValue(json, CommandCreateChatRoomTo.class);
33 assertThat(message.getName()).isEqualTo("Foo-Room!");