Skip to content

Commit 0240f27

Browse files
authored
Merge pull request #373 from sxci/upgrade_dependents
Upgrade dependents
2 parents adc3b4f + 1edb9cb commit 0240f27

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ repositories {
1212
}
1313

1414
dependencies {
15-
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.9.1'
16-
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
15+
compile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.11.0'
16+
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
1717
testCompile group: 'com.qiniu', name: 'happy-dns-java', version: '0.1.6'
1818
testCompile group: 'junit', name: 'junit', version: '4.12'
1919
}

src/main/java/com/qiniu/storage/model/BucketInfo.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ public class BucketInfo {
99
private String imageSource;
1010
@SerializedName("host")
1111
private String imageHost;
12+
// CHECKSTYLE:OFF
1213
@SerializedName("protected")
1314
private int _protected;
1415
@SerializedName("private")
1516
private int _private;
17+
// CHECKSTYLE:ON
1618
@SerializedName("no_index_page")
1719
private int noIndexPage;
1820
private int imgsft;

src/test/java/test/com/qiniu/storage/BucketTest.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public class BucketTest extends TestCase {
2121
private BucketManager bucketManagerNa0;
2222
private BucketManager dummyBucketManager;
2323

24+
ArrayList<Integer> batchStatusCode = new ArrayList(){{
25+
this.add(200);
26+
this.add(298);
27+
}};
28+
2429
@Override
2530
protected void setUp() throws Exception {
2631
//default config
@@ -353,15 +358,15 @@ public void testBatchCopy() {
353358
try {
354359
Response r = bucketManager.batch(ops);
355360
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
356-
assertEquals(200, bs[0].code);
361+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
357362
} catch (QiniuException e) {
358363
fail(e.response.toString());
359364
}
360365
ops = new BucketManager.BatchOperations().addDeleteOp(bucket, copyToKey);
361366
try {
362367
Response r = bucketManager.batch(ops);
363368
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
364-
assertEquals(200, bs[0].code);
369+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
365370
} catch (QiniuException e) {
366371
fail(e.response.toString());
367372
}
@@ -388,7 +393,7 @@ public void testBatchMove() {
388393
try {
389394
Response r = bucketManager.batch(ops);
390395
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
391-
assertEquals(200, bs[0].code);
396+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
392397
} catch (QiniuException e) {
393398
fail(e.response.toString());
394399
}
@@ -420,7 +425,7 @@ public void testBatchRename() {
420425
try {
421426
Response r = bucketManager.batch(ops);
422427
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
423-
assertEquals(200, bs[0].code);
428+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
424429
} catch (QiniuException e) {
425430
fail(e.response.toString());
426431
}
@@ -449,7 +454,7 @@ public void testBatchStat() {
449454
try {
450455
Response r = bucketManager.batch(ops);
451456
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
452-
assertEquals(200, bs[0].code);
457+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
453458
} catch (QiniuException e) {
454459
fail(e.response.toString());
455460
}
@@ -485,7 +490,7 @@ public void testBatchChangeType() {
485490
try {
486491
Response r = bucketManager.batch(ops);
487492
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
488-
assertEquals(200, bs[0].code);
493+
Assert.assertTrue("200 or 298", batchStatusCode.contains(bs[0].code));
489494
} catch (QiniuException e) {
490495
fail(e.response.toString());
491496
} finally {
@@ -519,9 +524,10 @@ public void testBatchCopyChgmDelete() {
519524
ops.addCopyOp(bucket, key, bucket, keyArray[i]);
520525
}
521526

527+
522528
try {
523529
Response response = bucketManager.batch(ops);
524-
Assert.assertEquals(200, response.statusCode);
530+
Assert.assertTrue("200 or 298", batchStatusCode.contains(response.statusCode));
525531

526532
//clear ops
527533
ops.clearOps();
@@ -531,14 +537,14 @@ public void testBatchCopyChgmDelete() {
531537
ops.addChgmOp(bucket, keyArray[i], "image/png");
532538
}
533539
response = bucketManager.batch(ops);
534-
Assert.assertEquals(200, response.statusCode);
540+
Assert.assertTrue("200 or 298", batchStatusCode.contains(response.statusCode));
535541

536542
//clear ops
537543
for (int i = 0; i < keyArray.length; i++) {
538544
ops.addDeleteOp(bucket, keyArray[i]);
539545
}
540546
response = bucketManager.batch(ops);
541-
Assert.assertEquals(200, response.statusCode);
547+
Assert.assertTrue("200 or 298", batchStatusCode.contains(response.statusCode));
542548

543549
} catch (QiniuException e) {
544550
fail(e.response.toString());
@@ -580,7 +586,7 @@ public void testBatch() {
580586
Response r = bucketManager.batch(ops);
581587
BatchStatus[] bs = r.jsonToObject(BatchStatus[].class);
582588
for (BatchStatus b : bs) {
583-
assertEquals(200, b.code);
589+
Assert.assertTrue("200 or 298", batchStatusCode.contains(b.code));
584590
}
585591
} catch (QiniuException e) {
586592
fail(e.response.toString());

0 commit comments

Comments
 (0)