File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
plugin-gradle/src/test/java/com/diffplug/gradle/spotless Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1616package com .diffplug .gradle .spotless ;
1717
1818import java .io .File ;
19+ import java .nio .file .Paths ;
1920
2021import org .assertj .core .api .Assertions ;
2122import org .gradle .api .file .DirectoryProperty ;
@@ -31,15 +32,15 @@ public void testThrowsMessageContainsFilename() throws Exception {
3132 SpotlessTaskImpl task = Mockito .mock (SpotlessTaskImpl .class , Mockito .CALLS_REAL_METHODS );
3233 Mockito .when (task .getLogger ()).thenReturn (Mockito .mock (Logger .class ));
3334
34- File projectDir = new File ("unitTests/ projectDir" );
35+ File projectDir = Paths . get ("unitTests" , " projectDir"). toFile ( );
3536 DirectoryProperty projectDirProperty = Mockito .mock (DirectoryProperty .class , Mockito .RETURNS_DEEP_STUBS );
3637 Mockito .when (projectDirProperty .get ().getAsFile ()).thenReturn (projectDir );
3738
3839 Mockito .when (task .getProjectDir ()).thenReturn (projectDirProperty );
3940
40- File input = new File ("unitTests/ projectDir/ someInput" );
41+ File input = Paths . get ("unitTests" , " projectDir" , " someInput"). toFile ( );
4142 Formatter formatter = Mockito .mock (Formatter .class );
4243
43- Assertions .assertThatThrownBy (() -> task .processInputFile (null , formatter , input )).hasMessageContaining ("unitTests/projectDir/someInput" );
44+ Assertions .assertThatThrownBy (() -> task .processInputFile (null , formatter , input )).hasMessageContaining (input . toString () );
4445 }
4546}
You can’t perform that action at this time.
0 commit comments