From: Kai Moritz Date: Fri, 9 Oct 2020 13:37:08 +0000 (+0200) Subject: Offsets are not needed by the test X-Git-Tag: rebase--2024-05-05--07-45~9 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=ed96e4da83b3323cf7350ddc3cccd79e2fd542aa;p=demos%2Fkafka%2Fdeduplication Offsets are not needed by the test --- diff --git a/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerIT.java b/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerIT.java index bf2fc2d..f88f371 100644 --- a/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerIT.java +++ b/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerIT.java @@ -33,11 +33,11 @@ public class DeduplicationTransformerIT context.register(store, null); transformer.init(context); context.setTopic("foo"); + context.setOffset(1); Iterator transformed; context.setPartition(0); - context.setOffset(1); transformed = transformer.transform("1", "1").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("1"); @@ -45,7 +45,6 @@ public class DeduplicationTransformerIT assertThat(store.get(0)).isEqualTo(1l); context.setPartition(1); - context.setOffset(1); transformed = transformer.transform("2", "2").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("2"); @@ -54,14 +53,12 @@ public class DeduplicationTransformerIT assertThat(store.get(1)).isEqualTo(2l); context.setPartition(0); - context.setOffset(2); transformed = transformer.transform("1", "1").iterator(); assertThat(transformed.hasNext()).isFalse(); assertThat(store.get(0)).isEqualTo(1l); assertThat(store.get(1)).isEqualTo(2l); context.setPartition(0); - context.setOffset(3); transformed = transformer.transform("1", "4").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("4"); @@ -71,7 +68,6 @@ public class DeduplicationTransformerIT // The order is only guaranteed per partition! context.setPartition(2); - context.setOffset(1); transformed = transformer.transform("3", "3").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("3"); @@ -81,7 +77,6 @@ public class DeduplicationTransformerIT assertThat(store.get(2)).isEqualTo(3l); context.setPartition(1); - context.setOffset(2); transformed = transformer.transform("2", "2").iterator(); assertThat(transformed.hasNext()).isFalse(); assertThat(store.get(0)).isEqualTo(4l); @@ -89,7 +84,6 @@ public class DeduplicationTransformerIT assertThat(store.get(2)).isEqualTo(3l); context.setPartition(2); - context.setOffset(2); transformed = transformer.transform("3", "5").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("5"); @@ -100,7 +94,6 @@ public class DeduplicationTransformerIT // The order is only guaranteed per partition! context.setPartition(1); - context.setOffset(3); transformed = transformer.transform("2", "6").iterator(); assertThat(transformed.hasNext()).isTrue(); assertThat(transformed.next()).isEqualTo("6");