Skip to content

Commit

Permalink
Fixes warning about deprecated method (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianszczepanik authored Apr 13, 2024
1 parent 8aed0cc commit 872b3f3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.masterthought.cucumber.json.Feature;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.apache.commons.io.filefilter.WildcardFileFilter.Builder;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.powermock.reflect.Whitebox;
Expand Down Expand Up @@ -188,7 +189,7 @@ void copyResources_OnInvalidPath_ThrowsException() throws Exception {

// then
try {
Whitebox.invokeMethod(builder, "copyResources", dir.getAbsolutePath(), new String[] { "someFile" });
Whitebox.invokeMethod(builder, "copyResources", dir.getAbsolutePath(), new String[]{"someFile"});
fail("Copying should fail!");
// exception depends on operating system or JVM version
} catch (ValidationException | InvalidPathException | NullPointerException e) {
Expand Down Expand Up @@ -527,13 +528,15 @@ void generateErrorPage_GeneratesErrorPage() throws Exception {
}

private File[] countHtmlFiles(Configuration configuration) {
FileFilter fileFilter = new WildcardFileFilter("*.html");
Builder builder = WildcardFileFilter.builder().setWildcards("*.html");
FileFilter fileFilter = builder.get();
File dir = new File(configuration.getReportDirectory(), ReportBuilder.BASE_DIRECTORY + configuration.getDirectorySuffixWithSeparator());
return dir.listFiles(fileFilter);
}

private File[] countHtmlFiles() {
FileFilter fileFilter = new WildcardFileFilter("*.html");
Builder builder = WildcardFileFilter.builder().setWildcards("*.html");
FileFilter fileFilter = builder.get();
File dir = new File(reportDirectory, ReportBuilder.BASE_DIRECTORY + configuration.getDirectorySuffixWithSeparator());
return dir.listFiles(fileFilter);
}
Expand Down

0 comments on commit 872b3f3

Please sign in to comment.