WIP:StringDeserializer
authorKai Moritz <kai@juplo.de>
Fri, 4 Nov 2022 07:25:08 +0000 (08:25 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 4 Nov 2022 11:52:13 +0000 (12:52 +0100)
src/main/java/de/juplo/kafka/Message.java [deleted file]
src/main/java/de/juplo/kafka/MessageAddNumber.java [deleted file]
src/main/java/de/juplo/kafka/MessageCalculateSum.java [deleted file]
src/test/java/de/juplo/kafka/MessageTest.java [deleted file]

diff --git a/src/main/java/de/juplo/kafka/Message.java b/src/main/java/de/juplo/kafka/Message.java
deleted file mode 100644 (file)
index e4999b7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package de.juplo.kafka;
-
-
-public abstract class Message
-{
-  public enum Type {ADD, CALC}
-
-  public abstract Type getType();
-}
diff --git a/src/main/java/de/juplo/kafka/MessageAddNumber.java b/src/main/java/de/juplo/kafka/MessageAddNumber.java
deleted file mode 100644 (file)
index c024b65..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package de.juplo.kafka;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import lombok.Data;
-
-
-@Data
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MessageAddNumber extends Message
-{
-  private Integer next;
-
-
-  @Override
-  public Type getType()
-  {
-    return Type.ADD;
-  }
-}
diff --git a/src/main/java/de/juplo/kafka/MessageCalculateSum.java b/src/main/java/de/juplo/kafka/MessageCalculateSum.java
deleted file mode 100644 (file)
index afc5a39..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package de.juplo.kafka;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import lombok.Data;
-
-
-@Data
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MessageCalculateSum extends Message
-{
-  @Override
-  public Type getType()
-  {
-    return Type.CALC;
-  }
-}
diff --git a/src/test/java/de/juplo/kafka/MessageTest.java b/src/test/java/de/juplo/kafka/MessageTest.java
deleted file mode 100644 (file)
index 52794ba..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package de.juplo.kafka;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.DisplayName;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.Arguments;
-import org.junit.jupiter.params.provider.MethodSource;
-import org.junit.jupiter.params.provider.ValueSource;
-
-import java.util.Arrays;
-import java.util.stream.IntStream;
-import java.util.stream.Stream;
-
-import static org.assertj.core.api.Assertions.*;
-
-
-public class MessageTest
-{
-  ObjectMapper mapper = new ObjectMapper();
-
-  @Test
-  @DisplayName("Deserialize a MessageAddNumber message")
-  public void testDeserializeMessageAddNumber()
-  {
-    Assertions.assertDoesNotThrow(() -> mapper.readValue("{\"next\":42}", MessageAddNumber.class));
-    Assertions.assertDoesNotThrow(() -> mapper.readValue("{\"number\":666,\"next\":42}", MessageAddNumber.class));
-  }
-
-  @Test
-  @DisplayName("Deserialize a MessageCalculateSum message")
-  public void testDeserializeMessageCalculateSum() throws JsonProcessingException
-  {
-    Assertions.assertDoesNotThrow(() -> mapper.readValue("{}", MessageCalculateSum.class));
-    Assertions.assertDoesNotThrow(() -> mapper.readValue("{\"number\":666}", MessageCalculateSum.class));
-  }
-}