CSVLogger { public void open() throws IOException { file = new File(filename); writer = bufferedWriterManager.open(file); LOGGER.info("Created csv file " + file.getPath()); }  void setFilename(String filename); String getFilename(); BufferedWriterManager getBufferedWriterManager(); void setBufferedWriterManager(BufferedWriterManager bufferedWriterManager); void setDelimiter(String delimiter); String getDelimiter(); void setNullString(String nullString); String getNullString(); void open(); void close(); void write(double value); void write(float value); void write(int value); void write(String string); void write(Date date); void writeLine(String[] values); void writeLine(String value); void writeLine(Date value); void writeLine(int value); void writeLine(float value); void writeLine(double value); @Override String toString(); static final String DEFAULT_DELIMITER; static final String DEFAULT_NULL_STRING; }
@Test public void openShouldDelegateToBufferedWriterManager() throws Exception { givenCSVLoggerIsCreated(); csvLogger.open(); verify(writerManagerMock).open(testFileManager.getTestFile()); verifyNoMoreInteractions(writerManagerMock); }