@Test public void getChannel_shouldReturnAResultWithAChannelAndAssociatedWriter() throws Exception { FileChannel testFileChannel = FileChannel.open(tempFiles.createTempFile(null), CREATE); when(mockPath.getFileSystem().provider().newFileChannel(same(mockPath), eq(CREATE_AND_APPEND))).thenReturn(testFileChannel); FileChannelProvider.Result result = provider.getChannel(); assertSame(testFileChannel, result.channel); ensureAssociated(result.writer, result.channel); ensureUtf8Charset(result.writer); assertTrue(testFileChannel.isOpen()); }
public Result getChannel() throws IOException { FileChannel fileChannel = FileChannel.open(path, CREATE, APPEND); Writer writer = Channels.newWriter(fileChannel, "UTF-8"); return new Result(fileChannel, writer); }
FileChannelProvider { public Result getChannel() throws IOException { FileChannel fileChannel = FileChannel.open(path, CREATE, APPEND); Writer writer = Channels.newWriter(fileChannel, "UTF-8"); return new Result(fileChannel, writer); } }
FileChannelProvider { public Result getChannel() throws IOException { FileChannel fileChannel = FileChannel.open(path, CREATE, APPEND); Writer writer = Channels.newWriter(fileChannel, "UTF-8"); return new Result(fileChannel, writer); } FileChannelProvider(Path path); }
FileChannelProvider { public Result getChannel() throws IOException { FileChannel fileChannel = FileChannel.open(path, CREATE, APPEND); Writer writer = Channels.newWriter(fileChannel, "UTF-8"); return new Result(fileChannel, writer); } FileChannelProvider(Path path); Result getChannel(); Path getPath(); }
FileChannelProvider { public Result getChannel() throws IOException { FileChannel fileChannel = FileChannel.open(path, CREATE, APPEND); Writer writer = Channels.newWriter(fileChannel, "UTF-8"); return new Result(fileChannel, writer); } FileChannelProvider(Path path); Result getChannel(); Path getPath();  }