22
22
import java .io .InputStream ;
23
23
import java .nio .file .Files ;
24
24
import java .nio .file .Path ;
25
- import java .nio .file .Paths ;
26
25
27
26
import org .junit .jupiter .api .Test ;
28
27
import org .junit .jupiter .api .io .TempDir ;
@@ -44,7 +43,7 @@ class SourcesTest {
44
43
45
44
@ Test
46
45
void testFromPath () {
47
- Path path = Paths . get ("/tmp" );
46
+ Path path = Path . of ("/tmp" );
48
47
Source source = Sources .fromPath (path );
49
48
50
49
assertNotNull (source );
@@ -54,7 +53,7 @@ void testFromPath() {
54
53
55
54
@ Test
56
55
void testBuildSource () {
57
- Path path = Paths . get ("/tmp" );
56
+ Path path = Path . of ("/tmp" );
58
57
ModelSource source = Sources .buildSource (path );
59
58
60
59
assertNotNull (source );
@@ -64,7 +63,7 @@ void testBuildSource() {
64
63
65
64
@ Test
66
65
void testResolvedSource () {
67
- Path path = Paths . get ("/tmp" );
66
+ Path path = Path . of ("/tmp" );
68
67
String location = "custom-location" ;
69
68
ModelSource source = Sources .resolvedSource (path , location );
70
69
@@ -77,7 +76,7 @@ void testResolvedSource() {
77
76
@ Test
78
77
void testPathSourceFunctionality () {
79
78
// Test basic source functionality
80
- Path path = Paths . get ("/tmp" );
79
+ Path path = Path . of ("/tmp" );
81
80
Sources .PathSource source = (Sources .PathSource ) Sources .fromPath (path );
82
81
83
82
assertEquals (path .normalize (), source .getPath ());
@@ -91,9 +90,9 @@ void testPathSourceFunctionality() {
91
90
@ Test
92
91
void testBuildPathSourceFunctionality () {
93
92
// Test build source functionality
94
- Path basePath = Paths . get ("/tmp" );
93
+ Path basePath = Path . of ("/tmp" );
95
94
ModelSource .ModelLocator locator = mock (ModelSource .ModelLocator .class );
96
- Path resolvedPath = Paths . get ("/tmp/subproject/pom.xml" );
95
+ Path resolvedPath = Path . of ("/tmp/subproject/pom.xml" );
97
96
when (locator .locateExistingPom (any (Path .class ))).thenReturn (resolvedPath );
98
97
99
98
Sources .BuildPathSource source = (Sources .BuildPathSource ) Sources .buildSource (basePath );
@@ -109,7 +108,7 @@ void testBuildPathSourceFunctionality() {
109
108
@ Test
110
109
void testResolvedPathSourceFunctionality () {
111
110
// Test resolved source functionality
112
- Path path = Paths . get ("/tmp" );
111
+ Path path = Path . of ("/tmp" );
113
112
String location = "custom-location" ;
114
113
Sources .ResolvedPathSource source = (Sources .ResolvedPathSource ) Sources .resolvedSource (path , location );
115
114
0 commit comments