File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io/input Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -327,6 +327,17 @@ void testReadEof() throws Exception {
327327 }
328328 }
329329
330+ @ Test
331+ void testSetReference () throws Exception {
332+ final ByteArrayInputStream first = new ByteArrayInputStream (new byte [2 ]);
333+ try (ProxyInputStream wrapped = new ProxyInputStreamFixture (first )) {
334+ assertSame (first , wrapped .unwrap ());
335+ final NullInputStream in = new NullInputStream ();
336+ wrapped .setReference (in );
337+ assertSame (in , wrapped .unwrap ());
338+ }
339+ }
340+
330341 @ Test
331342 void testSubclassAfterReadConsumer () throws Exception {
332343 final byte [] hello = "Hello" .getBytes (StandardCharsets .UTF_8 );
@@ -355,4 +366,12 @@ void testSubclassAfterReadConsumer() throws Exception {
355366 // @formatter:on
356367 }
357368
369+ @ Test
370+ void testUnwrap () throws Exception {
371+ final ByteArrayInputStream first = new ByteArrayInputStream (new byte [2 ]);
372+ try (ProxyInputStream wrapped = new ProxyInputStreamFixture (first )) {
373+ assertSame (first , wrapped .unwrap ());
374+ }
375+ }
376+
358377}
You can’t perform that action at this time.
0 commit comments