4040
4141import io .github .ascopes .jct .tests .helpers .UtilityClassTestTemplate ;
4242import io .github .ascopes .jct .utils .FileUtils ;
43+ import io .github .ascopes .jct .utils .StringUtils ;
4344import java .io .IOException ;
4445import java .net .MalformedURLException ;
4546import java .net .URI ;
@@ -120,7 +121,7 @@ void resolvePathRecursivelyResolvesThePathRecursively(
120121 String rootString ,
121122 String partsString ,
122123 String expectString
123- ) throws IOException {
124+ ) {
124125 // Given
125126 try (var fs = someTemporaryFileSystem ()) {
126127 var root = fs .getFileSystem ().getPath (rootString );
@@ -165,7 +166,7 @@ void assertValidRootNameFailsForInvalidRootNames(String rootName, String expecte
165166 // Then
166167 assertThatThrownBy (() -> assertValidRootName (rootName ))
167168 .isInstanceOf (IllegalArgumentException .class )
168- .hasMessage (expectedError );
169+ .hasMessage (expectedError + ": " + StringUtils . quoted ( rootName ) );
169170 }
170171
171172 @ DisplayName ("pathToBinaryName throws an IllegalArgumentException for absolute paths" )
@@ -179,7 +180,7 @@ void pathToBinaryNameThrowsIllegalArgumentExceptionForAbsolutePaths() {
179180 // Then
180181 assertThatThrownBy (() -> pathToBinaryName (path ))
181182 .isInstanceOf (IllegalArgumentException .class )
182- .hasMessage ("Path cannot be absolute (got /foo/bar/baz) " );
183+ .hasMessage ("Path cannot be absolute: \" /foo/bar/baz\" " );
183184 }
184185
185186 @ DisplayName ("pathToBinaryName converts relative paths as expected" )
@@ -192,8 +193,7 @@ void pathToBinaryNameThrowsIllegalArgumentExceptionForAbsolutePaths() {
192193 "org/example/foo/bar/Baz$Bork, org.example.foo.bar.Baz$Bork" ,
193194 })
194195 @ ParameterizedTest (name = "pathToBinaryName(\" {0}\" ) should return \" {1}\" " )
195- void pathToBinaryNameConvertsRelativePathsAsExpected (String input , String expected )
196- throws IOException {
196+ void pathToBinaryNameConvertsRelativePathsAsExpected (String input , String expected ) {
197197
198198 try (var fs = someTemporaryFileSystem ()) {
199199 // Given
@@ -262,7 +262,7 @@ void binaryNameToPathShouldReturnTheExpectedOutput(
262262 String binaryName ,
263263 Kind kind ,
264264 String expected
265- ) throws IOException {
265+ ) {
266266 try (var fs = someTemporaryFileSystem ()) {
267267 // Given
268268 var directoryPath = fs .getFileSystem ().getPath (directory );
@@ -293,7 +293,7 @@ void packageNameToPathShouldReturnTheExpectedOutput(
293293 String directory ,
294294 String packageName ,
295295 String expected
296- ) throws IOException {
296+ ) {
297297 try (var fs = someTemporaryFileSystem ()) {
298298 // Given
299299 var directoryPath = fs .getFileSystem ().getPath (directory );
@@ -325,7 +325,7 @@ void simpleClassNameToPathShouldReturnTheExpectedOutput(
325325 String className ,
326326 Kind kind ,
327327 String expected
328- ) throws IOException {
328+ ) {
329329 try (var fs = someTemporaryFileSystem ()) {
330330 // Given
331331 var packageDirectoryPath = fs .getFileSystem ().getPath (packageDirectory );
@@ -364,7 +364,7 @@ void resourceNameToPathShouldReturnTheExpectedOutput(
364364 String packageName ,
365365 String relativeName ,
366366 String expected
367- ) throws IOException {
367+ ) {
368368 try (var fs = someTemporaryFileSystem ()) {
369369 // Given
370370 var directoryPath = fs .getFileSystem ().getPath (directory );
@@ -391,7 +391,7 @@ void relativeResourceNameToPathShouldReturnTheExpectedOutput(
391391 String fragment ,
392392 String [] fragments ,
393393 String expected
394- ) throws IOException {
394+ ) {
395395 try (var fs = someTemporaryFileSystem ()) {
396396 // Given
397397 var directoryPath = fs .getFileSystem ().getPath (directory );
@@ -437,7 +437,7 @@ void relativeResourceNameToPathShouldReturnTheExpectedOutput(
437437 "'', OTHER" ,
438438 })
439439 @ ParameterizedTest (name = "pathToKind(\" {0}\" ) should return Kind.{1}" )
440- void pathToKindReturnsTheExpectedOutput (String pathName , Kind expectedKind ) throws IOException {
440+ void pathToKindReturnsTheExpectedOutput (String pathName , Kind expectedKind ) {
441441 try (var fs = someTemporaryFileSystem ()) {
442442 // Given
443443 var path = fs .getFileSystem ().getPath (pathName );
@@ -460,8 +460,7 @@ void pathToKindReturnsTheExpectedOutput(String pathName, Kind expectedKind) thro
460460 @ ParameterizedTest (
461461 name = "fileWithAnyKind([{0}])'s predicate should return false for non-existing path \" {1}\" "
462462 )
463- void fileWithAnyKindShouldFailIfThePathDoesNotExist (Kind kind , String pathName )
464- throws IOException {
463+ void fileWithAnyKindShouldFailIfThePathDoesNotExist (Kind kind , String pathName ) {
465464 try (var fs = someTemporaryFileSystem ()) {
466465 // Given
467466 var path = fs .getFileSystem ().getPath (pathName );
0 commit comments