diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-25 09:09:20 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-25 09:09:20 +0100 |
| commit | c09e0e47cfe3ff2938c84ccbef136fc56e277dcc (patch) | |
| tree | b197c8f148a49cbe42ef2874efff8415620aaf8b /examples/11-transient-0/output/java/src/test | |
| parent | c822482c9f93c836cabbce6489749fd958244e44 (diff) | |
Pass around (unused) shared values map in java-transient-0
Diffstat (limited to 'examples/11-transient-0/output/java/src/test')
| -rw-r--r-- | examples/11-transient-0/output/java/src/test/java/org/zwobble/example/Transient0Tests.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/11-transient-0/output/java/src/test/java/org/zwobble/example/Transient0Tests.java b/examples/11-transient-0/output/java/src/test/java/org/zwobble/example/Transient0Tests.java index 39eac79..0110de3 100644 --- a/examples/11-transient-0/output/java/src/test/java/org/zwobble/example/Transient0Tests.java +++ b/examples/11-transient-0/output/java/src/test/java/org/zwobble/example/Transient0Tests.java @@ -5,7 +5,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -209,20 +211,20 @@ public class Transient0Tests { Decoder<T> decoder ) throws IOException { var outputStream = new ByteArrayOutputStream(); - encoder.encode(value, outputStream); + encoder.encode(value, outputStream, new HashMap<>()); var bytes = outputStream.toByteArray(); var inputStream = new ByteArrayInputStream(bytes); - var decodedValue = decoder.decode(inputStream); + var decodedValue = decoder.decode(inputStream, new HashMap<>()); Assertions.assertEquals(value, decodedValue); } private interface Encoder<T> { - void encode(T value, OutputStream outputStream) throws IOException; + void encode(T value, OutputStream outputStream, Map<String, Object> sharedValues) throws IOException; } private interface Decoder<T> { - T decode(InputStream inputStream) throws IOException; + T decode(InputStream inputStream, Map<String, Object> sharedValues) throws IOException; } } |
