@@ -126,17 +126,6 @@ void testCloseIsShielded(final Class<? extends Channel> channelInterface) throws
126126 verify (channel , times (2 )).isOpen ();
127127 }
128128
129- @ Test
130- void testWrapFileChannel (final @ TempDir Path tempDir ) throws IOException {
131- final Path testFile = tempDir .resolve ("test.txt" );
132- FileUtils .touch (testFile .toFile ());
133- try (FileChannel channel = FileChannel .open (testFile ); Channel shield = CloseShieldChannel .wrap (channel )) {
134- fileChannelInterfaces ().forEach (iface -> assertInstanceOf (iface , shield ));
135- // FileChannel is not an interface, so can not be implemented.
136- assertFalse (shield instanceof FileChannel , "not FileChannel" );
137- }
138- }
139-
140129 @ Test
141130 void testDoesNotDoubleWrap () {
142131 final ByteChannel channel = mock (ByteChannel .class );
@@ -290,6 +279,17 @@ void testToString(final Class<? extends Channel> channelClass) throws Exception
290279 assertTrue (shieldString .contains ("MyChannel" ));
291280 }
292281
282+ @ Test
283+ void testWrapFileChannel (final @ TempDir Path tempDir ) throws IOException {
284+ final Path testFile = tempDir .resolve ("test.txt" );
285+ FileUtils .touch (testFile .toFile ());
286+ try (FileChannel channel = FileChannel .open (testFile ); Channel shield = CloseShieldChannel .wrap (channel )) {
287+ fileChannelInterfaces ().forEach (iface -> assertInstanceOf (iface , shield ));
288+ // FileChannel is not an interface, so can not be implemented.
289+ assertFalse (shield instanceof FileChannel , "not FileChannel" );
290+ }
291+ }
292+
293293 @ Test
294294 void testWritableByteChannelMethods () throws Exception {
295295 final WritableByteChannel channel = mock (WritableByteChannel .class );
0 commit comments