File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
toml/src/test/java/com/fasterxml/jackson/dataformat/toml Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
import static org .junit .Assert .assertNotNull ;
5
5
import static org .junit .Assert .assertTrue ;
6
6
7
+ import java .io .ByteArrayInputStream ;
7
8
import java .nio .charset .StandardCharsets ;
8
9
import java .util .Arrays ;
9
10
import java .util .List ;
@@ -208,12 +209,20 @@ public void testSimpleRectangle() throws Exception
208
209
+"bottomRight.y = 10\n "
209
210
, new String (toml , StandardCharsets .UTF_8 ));
210
211
211
- Rectangle result = MAPPER .readerFor (Rectangle .class )
212
- .readValue (toml );
212
+ Rectangle result ;
213
213
214
+ // Read first from static byte[]
215
+ result = MAPPER .readerFor (Rectangle .class )
216
+ .readValue (toml );
214
217
assertNotNull (result .topLeft );
215
218
assertNotNull (result .bottomRight );
219
+ assertEquals (input , result );
216
220
221
+ // and then via InputStream
222
+ result = MAPPER .readerFor (Rectangle .class )
223
+ .readValue (new ByteArrayInputStream (toml ));
224
+ assertNotNull (result .topLeft );
225
+ assertNotNull (result .bottomRight );
217
226
assertEquals (input , result );
218
227
}
219
228
You can’t perform that action at this time.
0 commit comments