projects
/
demos
/
kafka
/
deduplication
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further simplified the example: Knowledge about the key is not required
[demos/kafka/deduplication]
/
src
/
test
/
java
/
de
/
juplo
/
demo
/
kafka
/
deduplication
/
DeduplicationTransformerTest.java
diff --git
a/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerTest.java
b/src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerTest.java
index
59f6322
..
8862c03
100644
(file)
--- a/
src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerTest.java
+++ b/
src/test/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformerTest.java
@@
-43,7
+43,7
@@
public class DeduplicationTransformerTest
when(store.get(anyInt())).thenReturn(null);
when(context.partition()).thenReturn(0);
when(store.get(anyInt())).thenReturn(null);
when(context.partition()).thenReturn(0);
- Iterator<String> result = transformer.transform("
foo", "
1").iterator();
+ Iterator<String> result = transformer.transform("1").iterator();
assertThat(result.hasNext()).isTrue();
assertThat(result.next()).isEqualTo("1");
assertThat(result.hasNext()).isTrue();
assertThat(result.next()).isEqualTo("1");
@@
-60,7
+60,7
@@
public class DeduplicationTransformerTest
when(store.get(anyInt())).thenReturn(1l);
when(context.partition()).thenReturn(0);
when(store.get(anyInt())).thenReturn(1l);
when(context.partition()).thenReturn(0);
- Iterator<String> result = transformer.transform(
"foo",
value).iterator();
+ Iterator<String> result = transformer.transform(value).iterator();
assertThat(result.hasNext()).isTrue();
assertThat(result.next()).isEqualTo(value);
assertThat(result.hasNext()).isTrue();
assertThat(result.next()).isEqualTo(value);
@@
-77,7
+77,7
@@
public class DeduplicationTransformerTest
when(store.get(anyInt())).thenReturn(7l);
when(context.partition()).thenReturn(0);
when(store.get(anyInt())).thenReturn(7l);
when(context.partition()).thenReturn(0);
- Iterator<String> result = transformer.transform(
"foo",
value).iterator();
+ Iterator<String> result = transformer.transform(value).iterator();
assertThat(result.hasNext()).isFalse();
verify(store, never()).put(eq(0), eq(sequenceNumber));
assertThat(result.hasNext()).isFalse();
verify(store, never()).put(eq(0), eq(sequenceNumber));