@@ -40,7 +40,8 @@ void testCreateFiles(String path, boolean shouldWork) {
40
40
private static Stream <Arguments > testCreateFilesSource () {
41
41
return Stream .of (Arguments .of (TEST_PATH_TEMPORARY + "testCreateFiles1.txt" , true ),
42
42
Arguments .of (TEST_PATH_TEMPORARY + "testCreateFiles2.png" , true ), Arguments .of (TEST_PATH_TEMPORARY + "éà@--" , true ),
43
- Arguments .of (TEST_PATH + "existingFile.x" , false ), Arguments .of (TEST_PATH_TEMPORARY + "/2/3/4/t" , true ));
43
+ Arguments .of (TEST_PATH + "existingFile.x" , false ), Arguments .of (TEST_PATH_TEMPORARY + "/2/3/4/t" , true ),
44
+ Arguments .of (null , false ));
44
45
}
45
46
46
47
@ ParameterizedTest
@@ -54,7 +55,7 @@ void testCreateDirectory(String path, boolean shouldWork) {
54
55
private static Stream <Arguments > testCreateDirectorySource () {
55
56
return Stream .of (Arguments .of (TEST_PATH_TEMPORARY + "testCreateDirectory1" , true ),
56
57
Arguments .of (TEST_PATH_TEMPORARY + "testCreateDirectory2" , true ), Arguments .of (TEST_PATH_TEMPORARY + "éàOP%u%" , true ),
57
- Arguments .of (TEST_PATH , false ), Arguments .of (TEST_PATH_TEMPORARY + "DIR/2/3/4/t/" , true ));
58
+ Arguments .of (TEST_PATH , false ), Arguments .of (TEST_PATH_TEMPORARY + "DIR/2/3/4/t/" , true ), Arguments . of ( null , false ) );
58
59
}
59
60
60
61
@ ParameterizedTest
@@ -68,7 +69,8 @@ void testDelete(String path, boolean shouldWork, String pathToCreate) {
68
69
69
70
private static Stream <Arguments > testDeleteSource () {
70
71
return Stream .of (Arguments .of (TEST_PATH_TEMPORARY , true , TEST_PATH_TEMPORARY + "P/2/3/4" ),
71
- Arguments .of (TEST_PATH_TEMPORARY , false , null ), Arguments .of (TEST_PATH + "unexistingDirectory" , false , null ));
72
+ Arguments .of (TEST_PATH_TEMPORARY , false , null ), Arguments .of (TEST_PATH + "unexistingDirectory" , false , null ),
73
+ Arguments .of (null , false , null ));
72
74
}
73
75
74
76
@ ParameterizedTest
@@ -84,21 +86,25 @@ private static Stream<Arguments> testCopySource() {
84
86
return Stream .of (Arguments .of (TEST_PATH + "existingFile.x" , true , TEST_PATH_TEMPORARY + "existingFile.x" ), // normal copy
85
87
Arguments .of (TEST_PATH + "unexistingFile.x" , false , TEST_PATH_TEMPORARY + "unexistingFile.x" ), // copy of missing file
86
88
Arguments .of (TEST_PATH_TEMPORARY + "existingFile.x" , false , TEST_PATH_TEMPORARY + "existingFile.x" ), // don't exist here
87
- Arguments .of (TEST_PATH + "existingFile.x" , false , TEST_PATH + "existingFile.x" )); // same location
89
+ Arguments .of (TEST_PATH + "existingFile.x" , false , TEST_PATH + "existingFile.x" ), // same location
90
+ Arguments .of (null , false , TEST_PATH ), Arguments .of (TEST_PATH + "existingFile.x" , false , "" ));
88
91
}
89
92
90
93
@ ParameterizedTest
91
94
@ MethodSource ("testMoveSource" )
92
95
void testMove (String source , boolean shouldWork , String destination ) {
93
- assertEquals (true , FLUFiles .createFile (source ));
96
+ if (source != null ) {
97
+ assertEquals (true , FLUFiles .createFile (source ));
98
+ }
94
99
assertEquals (shouldWork , FLUFiles .move (source , destination ));
95
100
if (shouldWork ) {
96
101
assertEquals (true , FLUFiles .delete (destination ));
97
102
}
98
103
}
99
104
100
105
private static Stream <Arguments > testMoveSource () {
101
- return Stream .of (Arguments .of (TEST_PATH_TEMPORARY + "RTYUIFile.x" , true , TEST_PATH_TEMPORARY + "DTCFile.x" ));
106
+ return Stream .of (Arguments .of (TEST_PATH_TEMPORARY + "RTYUIFile.x" , true , TEST_PATH_TEMPORARY + "DTCFile.x" ),
107
+ Arguments .of (null , false , TEST_PATH ), Arguments .of (TEST_PATH_TEMPORARY + "exzbnkistingFile.x" , false , null ));
102
108
}
103
109
104
110
@ ParameterizedTest
0 commit comments