Skip to content

Commit 3f27a41

Browse files
author
shabtaisharon
committed
Merge pull request #168 from rpmoore/npe_fix
Added a check to the withProxy method in the ds3client builder to pre…
2 parents 3136b0f + 1802e6d commit 3f27a41

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

ds3-sdk-integration/src/test/java/com/spectralogic/ds3client/integration/Insecure_Test.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818
import com.spectralogic.ds3client.Ds3Client;
1919
import com.spectralogic.ds3client.commands.GetServiceRequest;
2020
import com.spectralogic.ds3client.commands.GetServiceResponse;
21-
import com.spectralogic.ds3client.integration.test.helpers.TempStorageIds;
22-
import com.spectralogic.ds3client.integration.test.helpers.TempStorageUtil;
23-
import com.spectralogic.ds3client.models.ChecksumType;
2421
import org.junit.AfterClass;
2522
import org.junit.BeforeClass;
2623
import org.junit.Test;
2724

2825
import java.io.IOException;
2926
import java.security.SignatureException;
30-
import java.util.UUID;
3127

3228
import static org.hamcrest.CoreMatchers.is;
3329
import static org.hamcrest.CoreMatchers.notNullValue;
@@ -41,19 +37,14 @@
4137
public class Insecure_Test {
4238

4339
private static Ds3Client client;
44-
private static final String TEST_ENV_NAME = "insecure_test";
45-
private static TempStorageIds envStorageIds;
4640

4741
@BeforeClass
4842
public static void startup() throws IOException, SignatureException {
49-
client = Util.fromEnv();
50-
final UUID dataPolicyId = TempStorageUtil.setupDataPolicy(TEST_ENV_NAME, true, ChecksumType.Type.MD5, client);
51-
envStorageIds = TempStorageUtil.setup(TEST_ENV_NAME, dataPolicyId, client);
43+
client = Util.insecureFromEnv();
5244
}
5345

5446
@AfterClass
5547
public static void teardown() throws IOException, SignatureException {
56-
TempStorageUtil.teardown(TEST_ENV_NAME, envStorageIds, client);
5748
client.close();
5849
}
5950

ds3-sdk/src/main/java/com/spectralogic/ds3client/Ds3ClientBuilder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public Ds3ClientBuilder withCertificateVerification(final boolean certificateVer
135135
* @throws IllegalArgumentException This will be thrown if the proxy endpoint is not a valid URI.
136136
*/
137137
public Ds3ClientBuilder withProxy(final String proxy) throws IllegalArgumentException {
138+
if (proxy == null) {
139+
LOG.warn("Proxy was null");
140+
return this;
141+
}
138142
try {
139143
final URI proxyUri;
140144
if(!proxy.startsWith("http")) {

0 commit comments

Comments
 (0)