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 16
16
package com .diffplug .gradle .spotless ;
17
17
18
18
import java .io .File ;
19
+ import java .nio .file .Paths ;
19
20
20
21
import org .assertj .core .api .Assertions ;
21
22
import org .gradle .api .file .DirectoryProperty ;
@@ -31,15 +32,15 @@ public void testThrowsMessageContainsFilename() throws Exception {
31
32
SpotlessTaskImpl task = Mockito .mock (SpotlessTaskImpl .class , Mockito .CALLS_REAL_METHODS );
32
33
Mockito .when (task .getLogger ()).thenReturn (Mockito .mock (Logger .class ));
33
34
34
- File projectDir = new File ("unitTests/ projectDir" );
35
+ File projectDir = Paths . get ("unitTests" , " projectDir"). toFile ( );
35
36
DirectoryProperty projectDirProperty = Mockito .mock (DirectoryProperty .class , Mockito .RETURNS_DEEP_STUBS );
36
37
Mockito .when (projectDirProperty .get ().getAsFile ()).thenReturn (projectDir );
37
38
38
39
Mockito .when (task .getProjectDir ()).thenReturn (projectDirProperty );
39
40
40
- File input = new File ("unitTests/ projectDir/ someInput" );
41
+ File input = Paths . get ("unitTests" , " projectDir" , " someInput"). toFile ( );
41
42
Formatter formatter = Mockito .mock (Formatter .class );
42
43
43
- Assertions .assertThatThrownBy (() -> task .processInputFile (null , formatter , input )).hasMessageContaining ("unitTests/projectDir/someInput" );
44
+ Assertions .assertThatThrownBy (() -> task .processInputFile (null , formatter , input )).hasMessageContaining (input . toString () );
44
45
}
45
46
}
You can’t perform that action at this time.
0 commit comments