FileOrDirectoryTaskOutput extends AbstractTaskOutput implements SingleOrMultipleTaskOutput { public static FileOrDirectoryTaskOutput directory(File directory) { if (directory == null || !directory.isDirectory()) { throw new IllegalArgumentException("A not null directory instance is expected. Path: " + directory); } return new FileOrDirectoryTaskOutput(directory); } FileOrDirectoryTaskOutput(File file); @Override File getDestination(); @Override void accept(TaskOutputDispatcher writer); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static FileOrDirectoryTaskOutput file(File file); static FileOrDirectoryTaskOutput directory(File directory);  }
@Test(expected = IllegalArgumentException.class) public void dirFactoryNullFile() { FileOrDirectoryTaskOutput.directory(null); }
@Test(expected = IllegalArgumentException.class) public void dirFactoryInvalidDirectory() { when(directory.isDirectory()).thenReturn(Boolean.FALSE); FileOrDirectoryTaskOutput.directory(directory); }
@Test public void dirFactoryValidDirectory() { when(directory.isDirectory()).thenReturn(Boolean.TRUE); FileOrDirectoryTaskOutput instance = FileOrDirectoryTaskOutput.directory(directory); assertNotNull(instance); }