1818 */
1919package org .apache .maven .buildcache ;
2020
21- import org .junit .jupiter .api .Test ;
22- import org .junit .jupiter .api .io .TempDir ;
23-
2421import java .io .IOException ;
2522import java .io .OutputStream ;
2623import java .nio .charset .StandardCharsets ;
3128import java .util .Arrays ;
3229import java .util .Set ;
3330
31+ import org .junit .jupiter .api .Test ;
32+ import org .junit .jupiter .api .io .TempDir ;
33+
3434import static org .junit .jupiter .api .Assertions .assertFalse ;
3535import static org .junit .jupiter .api .Assertions .assertTrue ;
3636
@@ -70,7 +70,7 @@ void testPermissionsAffectFileHashWhenEnabled() throws IOException {
7070 Path sourceDir2 = tempDir .resolve ("source2" );
7171 Files .createDirectories (sourceDir2 );
7272 Path file2 = sourceDir2 .resolve ("script.sh" );
73- writeString (file2 , "#!/bin/bash\n echo hello" ); // Identical content
73+ writeString (file2 , "#!/bin/bash\n echo hello" ); // Identical content
7474
7575 // Set non-executable permissions (644)
7676 Set <PosixFilePermission > normalPermissions = PosixFilePermissions .fromString ("rw-r--r--" );
@@ -87,10 +87,11 @@ void testPermissionsAffectFileHashWhenEnabled() throws IOException {
8787 byte [] hash2 = Files .readAllBytes (zip2 );
8888
8989 boolean hashesAreDifferent = !Arrays .equals (hash1 , hash2 );
90- assertTrue (hashesAreDifferent ,
91- "ZIP files with same content but different permissions should have different hashes " +
92- "when preservePermissions=true. This ensures cache invalidation when permissions change " +
93- "(executable vs non-executable files)." );
90+ assertTrue (
91+ hashesAreDifferent ,
92+ "ZIP files with same content but different permissions should have different hashes "
93+ + "when preservePermissions=true. This ensures cache invalidation when permissions change "
94+ + "(executable vs non-executable files)." );
9495 }
9596
9697 /**
@@ -119,7 +120,7 @@ void testPermissionsDoNotAffectHashWhenDisabled() throws IOException {
119120 Path sourceDir2 = tempDir .resolve ("source2" );
120121 Files .createDirectories (sourceDir2 );
121122 Path file2 = sourceDir2 .resolve ("script.sh" );
122- writeString (file2 , "#!/bin/bash\n echo hello" ); // Identical content
123+ writeString (file2 , "#!/bin/bash\n echo hello" ); // Identical content
123124
124125 // Set non-executable permissions (644)
125126 Set <PosixFilePermission > normalPermissions = PosixFilePermissions .fromString ("rw-r--r--" );
@@ -147,12 +148,12 @@ void testPermissionsDoNotAffectHashWhenDisabled() throws IOException {
147148
148149 // Files should NOT retain their original different permissions
149150 // Both should have default permissions determined by umask
150- assertFalse (perms1 .equals (execPermissions ) && perms2 .equals (normalPermissions ),
151- "When preservePermissions=false, original permissions should NOT be preserved. " +
152- "Files should use system default permissions (umask)." );
151+ assertFalse (
152+ perms1 .equals (execPermissions ) && perms2 .equals (normalPermissions ),
153+ "When preservePermissions=false, original permissions should NOT be preserved. "
154+ + "Files should use system default permissions (umask)." );
153155 }
154156
155-
156157 /**
157158 * Java 8 compatible version of Files.writeString().
158159 */
0 commit comments