@@ -365,17 +365,17 @@ public void testDuplicatePrunedPaths() {
365
365
366
366
public void testDuplicateExclusivePaths () {
367
367
// Bunch o' handy definitions
368
- var originalFileData = FileData .ofPath (path ("/a/b" ), READ ).withExclusive (true );
369
- var fileDataWithWriteMode = FileData .ofPath (path ("/a/b" ), READ_WRITE ).withExclusive (true );
368
+ var pathAB = path ("/a/b" );
369
+ var pathCD = path ("/c/d" );
370
+ var originalFileData = FileData .ofPath (pathAB , READ ).withExclusive (true );
371
+ var fileDataWithWriteMode = FileData .ofPath (pathAB , READ_WRITE ).withExclusive (true );
370
372
var original = new ExclusiveFileEntitlement ("component1" , "module1" , new FilesEntitlement (List .of (originalFileData )));
371
373
var differentComponent = new ExclusiveFileEntitlement ("component2" , original .moduleName (), original .filesEntitlement ());
372
374
var differentModule = new ExclusiveFileEntitlement (original .componentName (), "module2" , original .filesEntitlement ());
373
375
var differentPath = new ExclusiveFileEntitlement (
374
376
original .componentName (),
375
377
original .moduleName (),
376
- new FilesEntitlement (
377
- List .of (FileData .ofPath (path ("/c/d" ), originalFileData .mode ()).withExclusive (originalFileData .exclusive ()))
378
- )
378
+ new FilesEntitlement (List .of (FileData .ofPath (pathCD , originalFileData .mode ()).withExclusive (originalFileData .exclusive ())))
379
379
);
380
380
var differentMode = new ExclusiveFileEntitlement (
381
381
original .componentName (),
@@ -387,7 +387,7 @@ public void testDuplicateExclusivePaths() {
387
387
original .moduleName (),
388
388
new FilesEntitlement (List .of (originalFileData .withPlatform (WINDOWS )))
389
389
);
390
- var originalExclusivePath = new ExclusivePath ("component1" , Set .of ("module1" ), normalizePath (path ( "/a/b" ) ));
390
+ var originalExclusivePath = new ExclusivePath ("component1" , Set .of ("module1" ), normalizePath (pathAB ));
391
391
392
392
// Some basic tests
393
393
@@ -409,12 +409,17 @@ public void testDuplicateExclusivePaths() {
409
409
originalExclusivePath ,
410
410
new ExclusivePath ("component2" , Set .of (original .moduleName ()), originalExclusivePath .path ()),
411
411
new ExclusivePath (original .componentName (), Set .of ("module2" ), originalExclusivePath .path ()),
412
- new ExclusivePath (original .componentName (), Set .of (original .moduleName ()), normalizePath (path ( "/c/d" ) ))
412
+ new ExclusivePath (original .componentName (), Set .of (original .moduleName ()), normalizePath (pathCD ))
413
413
);
414
414
var iae = expectThrows (IllegalArgumentException .class , () -> buildExclusivePathList (distinctEntitlements , TEST_PATH_LOOKUP ));
415
+ var pathABString = pathAB .toAbsolutePath ().toString ();
415
416
assertThat (
416
417
iae .getMessage (),
417
- equalTo ("Path [/a/b] is already exclusive to [component1][module1], cannot add exclusive access for [component2][module1]" )
418
+ equalTo (
419
+ "Path ["
420
+ + pathABString
421
+ + "] is already exclusive to [component1][module1], cannot add exclusive access for [component2][module1]"
422
+ )
418
423
);
419
424
420
425
var equivalentEntitlements = List .of (original , differentMode , differentPlatform );
0 commit comments