diff --git a/src/main/java/com/qiniu/processing/OperationManager.java b/src/main/java/com/qiniu/processing/OperationManager.java index 7b9cbbe94..62fcbd0c0 100644 --- a/src/main/java/com/qiniu/processing/OperationManager.java +++ b/src/main/java/com/qiniu/processing/OperationManager.java @@ -116,10 +116,10 @@ public String pfop(String bucket, String key, StringMap params) throws QiniuExce } String pipeline = null; if (params.get("pipeline") != null) { - if (params.get("pipeline") instanceof Integer) { + if (params.get("pipeline") instanceof String) { pipeline = (String) params.get("pipeline"); } else { - throw QiniuException.unrecoverable("pipeline type error, String be Integer"); + throw QiniuException.unrecoverable("pipeline type error, should be String"); } } String notifyUrl = null; diff --git a/src/main/java/com/qiniu/storage/Region.java b/src/main/java/com/qiniu/storage/Region.java index 7a5069f6f..8ebacd1d1 100644 --- a/src/main/java/com/qiniu/storage/Region.java +++ b/src/main/java/com/qiniu/storage/Region.java @@ -436,12 +436,20 @@ public Builder region(String region) { } public Builder srcUpHost(String... srcUpHosts) { - this.region.srcUpHosts = Arrays.asList(srcUpHosts); + if (srcUpHosts == null) { + this.region.srcUpHosts = null; + } else { + this.region.srcUpHosts = Arrays.asList(srcUpHosts); + } return this; } public Builder accUpHost(String... accUpHosts) { - this.region.accUpHosts = Arrays.asList(accUpHosts); + if (accUpHosts == null) { + this.region.accUpHosts = null; + } else { + this.region.accUpHosts = Arrays.asList(accUpHosts); + } return this; } diff --git a/src/test/java/test/com/qiniu/processing/PfopTest.java b/src/test/java/test/com/qiniu/processing/PfopTest.java index f043f0f3c..914ef1861 100644 --- a/src/test/java/test/com/qiniu/processing/PfopTest.java +++ b/src/test/java/test/com/qiniu/processing/PfopTest.java @@ -57,7 +57,7 @@ public void testPfop() throws QiniuException { System.out.println(fops); try { - String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, null, notifyURL, force); + String jobid = operationManager.pfop(bucket, TestConfig.testMp4FileKey, fops, "", notifyURL, force); assertNotNull(jobid); assertNotEquals("", jobid); ids.add(jobid); diff --git a/src/test/java/test/com/qiniu/storage/FormUploadTest.java b/src/test/java/test/com/qiniu/storage/FormUploadTest.java index 6d854e913..3e1e25d1f 100644 --- a/src/test/java/test/com/qiniu/storage/FormUploadTest.java +++ b/src/test/java/test/com/qiniu/storage/FormUploadTest.java @@ -95,6 +95,8 @@ public void testSimple() { @Tag("IntegrationTest") public void testEmptyUploadHosts() { Region region = new Region.Builder() + .srcUpHost(null) + .accUpHost(null) .build(); Configuration config = new Configuration(region); UploadManager uploadManager = new UploadManager(config); diff --git a/src/test/java/test/com/qiniu/storage/RegionTest.java b/src/test/java/test/com/qiniu/storage/RegionTest.java index 957e54d04..e6b7aa0c2 100644 --- a/src/test/java/test/com/qiniu/storage/RegionTest.java +++ b/src/test/java/test/com/qiniu/storage/RegionTest.java @@ -1,5 +1,6 @@ package test.com.qiniu.storage; +import com.qiniu.common.QiniuException; import com.qiniu.storage.Region; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test;