Skip to content

Commit

Permalink
make sure no files.
Browse files Browse the repository at this point in the history
  • Loading branch information
sxci committed Dec 9, 2019
1 parent 5025e1f commit 5c721d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/test/java/test/com/qiniu/storage/BucketTest2.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ public void testListV2() {
try {
String[] buckets = new String[]{TestConfig.testBucket_z0};
for (String bucket : buckets) {
FileListing l = bucketManager.listFilesV2(bucket, "sdfisjfisjei", null, 2, null);
String prefix = "sdfisjfisjei473ysfGYDEJDSDJWEDJNFD23rje";
FileListing l = bucketManager.listFilesV2(bucket, prefix, null, 2, null);
Assert.assertTrue(l.items.length == 0);
Assert.assertNull(l.marker);
}

for (String bucket : buckets) {
Expand All @@ -181,13 +184,16 @@ public void testListV2() {
public void testListV2_1() {
try {
String marker = null;
int count = 0;
do{
FileListing l = bucketManager.listFilesV2(TestConfig.testBucket_z0, "pi", marker, 2, null);
marker = l.marker;
for (FileInfo f :l.items) {
Assert.assertNotNull(f.key);
}
count++;
} while(!StringUtils.isNullOrEmpty(marker));
Assert.assertTrue(count > 0);
} catch (QiniuException e) {
Assert.assertTrue(ResCode.find(e.code(), ResCode.getPossibleResCode()));
}
Expand Down

0 comments on commit 5c721d8

Please sign in to comment.