Skip to content

Commit 0e10dc4

Browse files
committed
Tiny test addition
1 parent 71c6eed commit 0e10dc4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

toml/src/test/java/com/fasterxml/jackson/dataformat/toml/POJOReadWriteTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.junit.Assert.assertNotNull;
55
import static org.junit.Assert.assertTrue;
66

7+
import java.io.ByteArrayInputStream;
78
import java.nio.charset.StandardCharsets;
89
import java.util.Arrays;
910
import java.util.List;
@@ -208,12 +209,20 @@ public void testSimpleRectangle() throws Exception
208209
+"bottomRight.y = 10\n"
209210
, new String(toml, StandardCharsets.UTF_8));
210211

211-
Rectangle result = MAPPER.readerFor(Rectangle.class)
212-
.readValue(toml);
212+
Rectangle result;
213213

214+
// Read first from static byte[]
215+
result = MAPPER.readerFor(Rectangle.class)
216+
.readValue(toml);
214217
assertNotNull(result.topLeft);
215218
assertNotNull(result.bottomRight);
219+
assertEquals(input, result);
216220

221+
// and then via InputStream
222+
result = MAPPER.readerFor(Rectangle.class)
223+
.readValue(new ByteArrayInputStream(toml));
224+
assertNotNull(result.topLeft);
225+
assertNotNull(result.bottomRight);
217226
assertEquals(input, result);
218227
}
219228

0 commit comments

Comments
 (0)