Skip to content

Commit f9d4e4f

Browse files
committed
GH-294: Allow call chaining on PackageContainerGroupAssert#allFilesExist
1 parent e969f7c commit f9d4e4f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PackageContainerGroupAssert.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,34 @@ public PackageContainerGroupAssert(@Nullable PackageContainerGroup containerGrou
5959
*
6060
* @param path the first path to check for
6161
* @param paths additional paths to check for.
62+
* @return this object for further call chaining.
6263
* @throws AssertionError if the container group is null, or if any of the files do not
6364
* exist.
6465
* @throws NullPointerException if any of the paths are null.
6566
*/
66-
public void allFilesExist(String path, String... paths) {
67+
public PackageContainerGroupAssert allFilesExist(String path, String... paths) {
6768
requireNonNull(path, "path must not be null");
6869
requireNonNullValues(paths, "paths");
6970

70-
allFilesExist(combineOneOrMore(path, paths));
71+
return allFilesExist(combineOneOrMore(path, paths));
7172
}
7273

7374
/**
7475
* Assert that all given files exist.
7576
*
7677
* @param paths paths to check for.
78+
* @return this object for further call chaining.
7779
* @throws AssertionError if the container group is null, or if any of the files do not
7880
* exist.
7981
* @throws NullPointerException if any of the paths are null.
8082
*/
81-
public void allFilesExist(Iterable<String> paths) {
83+
public PackageContainerGroupAssert allFilesExist(Iterable<String> paths) {
8284
requireNonNullValues(paths, "paths");
8385

8486
isNotNull();
8587

8688
assertThat(paths).allSatisfy(this::fileExists);
89+
return this;
8790
}
8891

8992
/**

0 commit comments

Comments
 (0)