File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
src/test/java/org/owasp/esapi/reference Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -80,21 +80,17 @@ public void testEscapeCharactersInFilename() {
80
80
}
81
81
82
82
File sf = new File (testDir , "test^.file" );
83
- if ( sf .exists () ) {
84
- System .out .println ( " Injection allowed " + sf .getAbsolutePath () );
85
- } else {
86
- System .out .println ( " Injection didn't work " + sf .getAbsolutePath () );
87
- }
83
+ assertFalse ("Injection didn't work " + sf .getAbsolutePath (),
84
+ sf .exists ());
85
+ assertTrue (" Injection allowed " + sf .getAbsolutePath (), sf .exists ());
88
86
}
89
87
90
88
public void testEscapeCharacterInDirectoryInjection () {
91
89
System .out .println ("testEscapeCharacterInDirectoryInjection" );
92
90
File sf = new File (testDir , "test\\ ^.^.\\ file" );
93
- if ( sf .exists () ) {
94
- System .out .println ( " Injection allowed " + sf .getAbsolutePath () );
95
- } else {
96
- System .out .println ( " Injection didn't work " + sf .getAbsolutePath () );
97
- }
91
+ assertFalse (" Injection didn't work " + sf .getAbsolutePath (),
92
+ sf .exists ());
93
+ assertTrue (" Injection allowed " + sf .getAbsolutePath (), sf .exists ());
98
94
}
99
95
100
96
public void testJavaFileInjectionGood () throws ValidationException
@@ -275,5 +271,4 @@ public void testCreateParentPercentNull()
275
271
// expected
276
272
}
277
273
}
278
-
279
274
}
You can’t perform that action at this time.
0 commit comments