@Test(expected = IllegalArgumentException.class) public void getFileByParentDirectoryPathAndFolderNameAndFilenameShouldThrowIllegalArgumentExceptionWhenFilenameIsNull() { // Given // When fileHandler.getFileByParentDirectoryPathAndFolderNameAndFilename( FOLDER_NAME_PARENT, FOLDER_NAME_ACTUAL, null); // Then }
@Test public void getFileByParentDirectoryPathAndFolderNameAndFilenameShouldReturnExistingFileWhenAllParamIsValid() { // Given File expectedFile = new File( FOLDER_NAME_PARENT + File.separator + FOLDER_NAME_ACTUAL + File.separator + FILENAME); // When File actualFile = fileHandler.getFileByParentDirectoryPathAndFolderNameAndFilename( FOLDER_NAME_PARENT, FOLDER_NAME_ACTUAL, FILENAME); // Then assertThat(actualFile, equalTo(expectedFile)); }