File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 39
39
import org .junit .jupiter .api .BeforeAll ;
40
40
import org .junit .jupiter .api .BeforeEach ;
41
41
import org .junit .jupiter .api .Test ;
42
+ import org .junit .jupiter .params .ParameterizedTest ;
43
+ import org .junit .jupiter .params .provider .ValueSource ;
42
44
import org .mockito .ArgumentCaptor ;
43
45
import software .amazon .awssdk .core .exception .SdkClientException ;
44
46
import software .amazon .awssdk .services .s3 .model .EncodingType ;
@@ -115,13 +117,14 @@ void downloadDirectory_allDownloadsSucceed_failedDownloadsShouldBeEmpty() throws
115
117
"key2" ));
116
118
}
117
119
118
- @ Test
119
- void invalidKey_shouldThrowException () throws Exception {
120
- assertExceptionThrownForInvalidKeys ("../key1" );
121
- assertExceptionThrownForInvalidKeys ("/../key1" );
122
- assertExceptionThrownForInvalidKeys ("blah/../../object.dat" );
123
- assertExceptionThrownForInvalidKeys ("blah/../object/../../blah/another/object.dat" );
124
- assertExceptionThrownForInvalidKeys ("../{directory-name}-2/object.dat" );
120
+ @ ParameterizedTest
121
+ @ ValueSource (strings = {"/blah" ,
122
+ "../blah/object.dat" ,
123
+ "blah/../../object.dat" ,
124
+ "blah/../object/../../blah/another/object.dat" ,
125
+ "../{directory-name}-2/object.dat" })
126
+ void invalidKey_shouldThrowException (String testingString ) throws Exception {
127
+ assertExceptionThrownForInvalidKeys (testingString );
125
128
}
126
129
127
130
private void assertExceptionThrownForInvalidKeys (String key ) throws IOException {
You can’t perform that action at this time.
0 commit comments