Skip to content

Commit c5c1186

Browse files
committed
Updated tests
1 parent bd5982b commit c5c1186

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/main/java/com/uid2/shared/attest/UidCoreClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public UidCoreClient(String userToken,
4747
this.httpClient = httpClient;
4848
}
4949
if (attestationResponseHandler == null) {
50-
throw new IllegalArgumentException("attestationTokenRetriever can not be null");
50+
throw new IllegalArgumentException("attestationResponseHandler can not be null");
5151
} else {
5252
this.attestationResponseHandler = attestationResponseHandler;
5353
}

src/main/java/com/uid2/shared/attest/UidOptOutClient.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ public class UidOptOutClient extends UidCoreClient {
1515
private AttestationResponseHandler attestationResponseHandler;
1616

1717
public UidOptOutClient(String userToken,
18-
Proxy proxy,
19-
AttestationResponseHandler attestationResponseHandler) {
18+
Proxy proxy,
19+
AttestationResponseHandler attestationResponseHandler) {
2020
super(userToken, proxy, attestationResponseHandler, null);
2121
this.attestationResponseHandler = attestationResponseHandler;
2222
}
23+
2324
public UidOptOutClient(String userToken,
2425
Proxy proxy,
2526
AttestationResponseHandler attestationResponseHandler,
@@ -39,7 +40,7 @@ public InputStream download(String path) throws CloudStorageException {
3940
path = "";
4041
}
4142

42-
if (this.attestationResponseHandler != null && this.attestationResponseHandler.getOptOutUrl() != null) {
43+
if (this.attestationResponseHandler.getOptOutUrl() != null) {
4344
try {
4445
URL baseUrl = new URL(this.attestationResponseHandler.getOptOutUrl());
4546
URL fullUrl = new URL(baseUrl, path);

src/test/java/com/uid2/shared/attest/UidCoreClientTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public void Download_Attest401_AttestCalledTwice() throws CloudStorageException,
8484

8585
uidCoreClient.download("https://download");
8686
verify(mockAttestationResponseHandler, times(2)).attest();
87+
verify(mockAttestationResponseHandler, never()).getOptOutUrl();
8788
}
8889

8990
@Test

0 commit comments

Comments
 (0)