ExcelSink implements ISink { @Override public void close() throws TexeraException { if (cursor == CLOSED) { return; } inputOperator.close(); try { wb.write(fileOut); fileOut.close(); cursor = CLOSED; } catch (IOException e) { throw new DataflowException(e); } } ExcelSink(ExcelSinkPredicate predicate); void setInputOperator(IOperator inputOperator); IOperator getInputOperator(); @Override Schema getOutputSchema(); @Override void open(); @Override void processTuples(); @Override Tuple getNextTuple(); @Override void close(); List<Tuple> collectAllTuples(); Path getFilePath(); Schema transformToOutputSchema(Schema... inputSchema);  }
@Test public void testClose() throws Exception { excelSink.open(); excelSink.close(); Mockito.verify(inputOperator).close(); Files.deleteIfExists(excelSink.getFilePath()); }