Skip to content

Commit

Permalink
Remove MockPathsBaseTest (#2292)
Browse files Browse the repository at this point in the history
  • Loading branch information
scordio committed Aug 15, 2021
1 parent 4cddfb5 commit d391e20
Show file tree
Hide file tree
Showing 57 changed files with 2,847 additions and 2,870 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/assertj/core/api/AbstractPathAssert.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public SELF hasSameContentAs(Path expected) {
* @since 3.15
*/
public SELF hasSameTextualContentAs(Path expected) {
paths.assertHasSameContentAs(info, actual, charset, expected, Charset.defaultCharset());
paths.assertHasSameTextualContentAs(info, actual, charset, expected, Charset.defaultCharset());
return myself;
}

Expand Down Expand Up @@ -198,7 +198,7 @@ public SELF hasSameTextualContentAs(Path expected) {
* @since 3.15
*/
public SELF hasSameTextualContentAs(Path expected, Charset expectedCharset) {
paths.assertHasSameContentAs(info, actual, charset, expected, expectedCharset);
paths.assertHasSameTextualContentAs(info, actual, charset, expected, expectedCharset);
return myself;
}

Expand Down Expand Up @@ -377,7 +377,7 @@ public SELF usingCharset(Charset charset) {
* @throws AssertionError if the content of the actual {@code Path} is not equal to the given content.
*/
public SELF hasContent(String expected) {
paths.assertHasContent(info, actual, expected, charset);
paths.assertHasTextualContent(info, actual, expected, charset);
return myself;
}

Expand Down
38 changes: 1 addition & 37 deletions src/main/java/org/assertj/core/internal/NioFilesWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,54 +22,18 @@
import java.util.function.Predicate;

/**
* Wrapper for <code>{@link java.nio.file.Files}</code> to test {@link Paths}.
* Wrapper for <code>{@link java.nio.file.Files}</code> to test methods throwing {@link IOException}.
*/
public class NioFilesWrapper {

private static final NioFilesWrapper INSTANCE = new NioFilesWrapper();

/**
* Returns the singleton instance of this class.
* @return the singleton instance of this class.
*/
static NioFilesWrapper instance() {
return INSTANCE;
}

private NioFilesWrapper() {}

public boolean isRegularFile(Path path) {
return Files.isRegularFile(path);
}

public boolean isSymbolicLink(Path path) {
return Files.isSymbolicLink(path);
}

public boolean isDirectory(Path path) {
return Files.isDirectory(path);
}

public boolean exists(Path path, LinkOption... options) {
return Files.exists(path, options);
}

public boolean notExists(Path path, LinkOption... options) {
return Files.notExists(path, options);
}

public boolean isReadable(Path path) {
return Files.isReadable(path);
}

public boolean isWritable(Path path) {
return Files.isWritable(path);
}

public boolean isExecutable(Path path) {
return Files.isExecutable(path);
}

public InputStream newInputStream(Path path, OpenOption... options) throws IOException {
return Files.newInputStream(path, options);
}
Expand Down

0 comments on commit d391e20

Please sign in to comment.