Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
efa2f7a
chore: poc of using OkHttp in Java SDK
antusus Aug 16, 2022
dc56ebd
chore: Using OkHttp to upload file
antusus Aug 17, 2022
f3ca4d2
chore: TestConfig.java in unit tests no longer collides with TestConf…
antusus Aug 17, 2022
89f2c87
Revert "chore: TestConfig.java in unit tests no longer collides with …
antusus Aug 19, 2022
639ee1d
Merge branch 'main' into kb/ok-http
antusus Aug 19, 2022
6f41520
fix: Fixed canceling sign request fails because of empty body (#1085)
antusus Aug 19, 2022
a9141d7
Merge branch 'main' into kb/ok-http
antusus Aug 19, 2022
e5da590
Merge branch 'main' into kb/ok-http
antusus Aug 19, 2022
14dca51
Merge branch 'main' into kb/ok-http
antusus Aug 26, 2022
70675e8
chore: Fixing building proper responses
antusus Aug 31, 2022
6c19820
chore: Fixed options method
antusus Sep 14, 2022
e7c87a6
chore: Fixed BoxAPIResponseException.java
antusus Sep 14, 2022
b26a16f
Merge branch 'main' into kb/ok-http
antusus Oct 3, 2022
9d38158
fix: Fix getting representation test
antusus Oct 3, 2022
ac8724e
fix: Tests in `BoxFileTest` fixed. We are not sending `Accept-Encodin…
antusus Oct 4, 2022
1d23628
fix: 202 responses can have body
antusus Oct 4, 2022
41ae835
fix: all unit tests passes
antusus Oct 5, 2022
2d45577
fix: replacing `BoxAPIRequest` with `BoxJSONRequest` where appropriate
antusus Oct 5, 2022
d047bdc
fix: Fixed upload listener reporting incorrect size
antusus Oct 5, 2022
1cde598
fix: Removed getInfo() method
antusus Oct 5, 2022
ab06e40
fix: Fixed `MetadataTemplate#deleteMetadataTemplate`
antusus Oct 6, 2022
d799f4d
fix: Fixed missing setting connection and read timeouts.
antusus Oct 6, 2022
0d0c0fd
fix: Can upload data using callback
antusus Oct 6, 2022
711f2ed
chore: DRY on execute request
antusus Oct 7, 2022
f07cd8c
chore: remove reduntant variable assigment
antusus Oct 7, 2022
a0e52d6
chore: various fixes
antusus Oct 7, 2022
f24801e
chore: content types are constants
antusus Oct 10, 2022
8e5715c
chore: Move json to files
antusus Oct 10, 2022
693ca20
chore: More tests on headers
antusus Oct 10, 2022
f93791a
chore: Test how GZIP is handled
antusus Oct 10, 2022
a6302d3
chore: Logging response body if JSON
antusus Oct 10, 2022
096a263
chore: Fixing IT Tests
antusus Oct 10, 2022
22d9b36
chore: Avatar can be downloaded we are no longer returning InputStream
antusus Oct 10, 2022
12e9d5d
Merge branch 'main' into kb/ok-http
antusus Oct 10, 2022
3e594b5
chore: Disable TODO checking
antusus Oct 10, 2022
a078965
Merge branch 'main' into kb/ok-http
antusus Oct 11, 2022
5dbc657
chore: removing some todos
antusus Oct 11, 2022
bd583f5
chore: fixed documentation
antusus Oct 12, 2022
c03f53f
chore: renamed class
antusus Oct 12, 2022
508cf53
chore: formatting
antusus Oct 12, 2022
8ec8eba
chore: Restored public static methods
antusus Oct 13, 2022
0be85cf
chore: Restored getAvatar method
antusus Oct 13, 2022
1859794
Merge branch 'main' into kb/ok-http
antusus Oct 17, 2022
906fc2d
chore: remove empty catch block (#1113)
antusus Oct 17, 2022
81d7f4d
feat: `BoxAPIResponse` implements `Closeable` (#1115)
antusus Oct 20, 2022
8894af4
chore: Removed deprecated methods (#1116)
antusus Nov 3, 2022
caf581a
feat: Adding proxy support (#1118)
antusus Nov 10, 2022
5353813
Merge branch 'main' into kb/ok-http
antusus Nov 10, 2022
b5d4872
Merge branch 'main' into kb/ok-http
antusus Nov 10, 2022
3cf3fbb
Merge branch 'main' into kb/ok-http
antusus Nov 15, 2022
14c3598
Merge branch 'main' into kb/ok-http
antusus Nov 16, 2022
b391f22
Merge branch 'main' into kb/ok-http
antusus Nov 17, 2022
e92c71a
fix: Fixed restoring state when refresh token is missing. Added tests…
antusus Nov 22, 2022
1df176d
fix: Fixed NPE thrown when logging enabled. (#1126)
antusus Nov 25, 2022
a670382
feat: Allow self-signed certificates in SDK (#1128)
antusus Dec 7, 2022
e1b4dda
fix!: Removal of deprecated methods (#1133)
antusus Dec 21, 2022
de323b0
chore: added toc to upgrade, added more libraries to README.md
antusus Dec 21, 2022
1a3dd1c
Merge branch 'main' into kb/ok-http
antusus Jan 10, 2023
d608607
fix: Fixed docs (#1142)
antusus Jan 11, 2023
d5dcde8
Merge branch 'main' into kb/ok-http
antusus Jan 17, 2023
a977e81
chore: Final final fixes (#1143)
antusus Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: content types are constants
  • Loading branch information
antusus committed Oct 10, 2022
commit f24801e48833c90cac68a77f1e15f9ef981f015e
8 changes: 5 additions & 3 deletions src/main/java/com/box/sdk/BoxAPIResponse.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static java.lang.String.format;

import com.eclipsesource.json.Json;
Expand Down Expand Up @@ -32,7 +33,6 @@
*/
public class BoxAPIResponse {
private static final BoxLogger LOGGER = BoxLogger.defaultLogger();
private static final int BUFFER_SIZE = 8192;
private final Map<String, List<String>> headers;
private final long contentLength;
private final String contentType;
Expand Down Expand Up @@ -71,7 +71,9 @@ public BoxAPIResponse() {
* @param responseCode http response code
* @param headers map of headers
*/
public BoxAPIResponse(int responseCode, String requestMethod, String requestUrl, Map<String, List<String>> headers) {
public BoxAPIResponse(
int responseCode, String requestMethod, String requestUrl, Map<String, List<String>> headers
) {
this(responseCode, requestMethod, requestUrl, headers, null, null, 0);
}

Expand Down Expand Up @@ -127,7 +129,7 @@ static BoxAPIResponse toBoxResponse(Response response) {
);
}
if (responseBody != null && responseBody.contentType() != null) {
if (responseBody.contentType().toString().contains("application/json")) {
if (responseBody.contentType().toString().contains(APPLICATION_JSON)) {
String bodyAsString = "";
try {
bodyAsString = responseBody.string();
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/box/sdk/BoxFile.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.box.sdk.http.ContentType.APPLICATION_JSON_PATCH;
import static com.eclipsesource.json.Json.NULL;

import com.box.sdk.http.HttpMethod;
Expand Down Expand Up @@ -1349,7 +1351,7 @@ public Metadata updateMetadata(Metadata metadata) {

URL url = METADATA_URL_TEMPLATE.buildAlpha(this.getAPI().getBaseURL(), this.getID(),
scope, metadata.getTemplateName());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT", "application/json-patch+json");
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT", APPLICATION_JSON_PATCH);
request.setBody(metadata.getPatch());
BoxJSONResponse response = request.send();
return new Metadata(Json.parse(response.getJSON()).asObject());
Expand Down Expand Up @@ -1446,7 +1448,7 @@ public BoxFileUploadSession.Info createUploadSession(long fileSize) {
URL url = UPLOAD_SESSION_URL_TEMPLATE.build(this.getAPI().getBaseUploadURL(), this.getID());

BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST");
request.addHeader("Content-Type", "application/json");
request.addHeader("Content-Type", APPLICATION_JSON);

JsonObject body = new JsonObject();
body.add("file_size", fileSize);
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/box/sdk/BoxFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.box.sdk.PagingParameters.DEFAULT_LIMIT;
import static com.box.sdk.PagingParameters.marker;
import static com.box.sdk.PagingParameters.offset;
import static com.box.sdk.http.ContentType.APPLICATION_JSON_PATCH;

import com.box.sdk.internal.utils.Parsers;
import com.box.sdk.sharedlink.BoxSharedLinkRequest;
Expand Down Expand Up @@ -578,10 +579,10 @@ public BoxFile.Info uploadFile(FileUploadParams uploadParams) {

BoxJSONResponse response;
if (uploadParams.getProgressListener() == null) {
// uppload files sends multipart request but response is JSON
// upload files sends multipart request but response is JSON
response = (BoxJSONResponse) request.send();
} else {
// uppload files sends multipart request but response is JSON
// upload files sends multipart request but response is JSON
response = (BoxJSONResponse) request.send(uploadParams.getProgressListener());
}
JsonObject collection = Json.parse(response.getJSON()).asObject();
Expand Down Expand Up @@ -1034,7 +1035,7 @@ public Metadata getMetadata(String templateName, String scope) {
public Metadata updateMetadata(Metadata metadata) {
URL url = METADATA_URL_TEMPLATE.buildAlpha(this.getAPI().getBaseURL(), this.getID(), metadata.getScope(),
metadata.getTemplateName());
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT", "application/json-patch+json");
BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT", APPLICATION_JSON_PATCH);
request.setBody(metadata.getPatch());
BoxJSONResponse response = request.send();
return new Metadata(Json.parse(response.getJSON()).asObject());
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/box/sdk/BoxJSONRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;

import com.box.sdk.http.HttpMethod;
import com.eclipsesource.json.Json;
import com.eclipsesource.json.JsonObject;
Expand Down Expand Up @@ -27,7 +29,7 @@ protected BoxJSONRequest(BoxAPIConnection api, URL url, String method, String me
* @param method the HTTP method of the request.
*/
public BoxJSONRequest(BoxAPIConnection api, URL url, String method) {
this(api, url, method, "application/json");
this(api, url, method, APPLICATION_JSON);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/box/sdk/http/ContentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public final class ContentType {
*/
public static final String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";

/**
* It is used when the HTTP request content type is application/json-patch+json.
*/
public static final String APPLICATION_JSON_PATCH = "application/json-patch+json";

//Prevents instantiation
private ContentType() {
}
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/com/box/sdk/BoxAPIConnectionTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
Expand Down Expand Up @@ -184,7 +185,7 @@ public void revokeTokenCallsCorrectEndpoint() {
wireMockRule.stubFor(post(urlPathEqualTo("/oauth2/revoke"))
.withRequestBody(WireMock.equalTo("token=fakeAccessToken&client_id=fakeID&client_secret=fakeSecret"))
.willReturn(aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody("{}")));

api.revokeToken();
Expand Down Expand Up @@ -642,7 +643,7 @@ private void mockAndAssertRevoke(String token, String clientID, String clientSec
)
))
.willReturn(aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(
"{\"refresh_token\":\"refresh-token\", \"access_token\":\"access-token\", \"expires_in\": 1}"
)));
Expand All @@ -656,7 +657,7 @@ private void mockAndAssertAuthentication(String clientId, String clientSecret, S
)
))
.willReturn(aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(
"{\"refresh_token\":\"refresh-token\", \"access_token\":\"access-token\", \"expires_in\": 1}"
)));
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/com/box/sdk/BoxAPIRequestTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor;
Expand Down Expand Up @@ -107,7 +108,7 @@ public void requestSendsXBoxUAHeader() throws MalformedURLException {

stubFor(get(urlEqualTo("/")).willReturn(aResponse()
.withStatus(202)
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody("{}")));

BoxAPIRequest request = new BoxAPIRequest(new BoxAPIConnection(""), boxMockUrl(), "GET");
Expand Down Expand Up @@ -166,7 +167,7 @@ public void whenJsonCannotBeParseExceptionIsThrown() throws IOException {
stubFor(get(urlEqualTo("/")).willReturn(
aResponse()
.withStatus(200)
.withHeader("content-type", "application/json")
.withHeader("content-type", APPLICATION_JSON)
.withBody("Not a Json".getBytes(UTF_8))
));
try {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/box/sdk/BoxAPIResponseExceptionTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
Expand All @@ -17,7 +18,6 @@
import com.eclipsesource.json.JsonObject;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
Expand Down Expand Up @@ -72,7 +72,7 @@ public void testAPIResponseExceptionReturnsCorrectErrorMessage() throws Malforme
stubFor(post(urlEqualTo("/folders"))
.willReturn(aResponse()
.withStatus(409)
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(fakeJSONResponse.toString())));

BoxAPIRequest request = new BoxAPIRequest(api, foldersUrl(), "POST");
Expand Down Expand Up @@ -112,7 +112,7 @@ public void testAPIResponseExceptionMissingFieldsReturnsCorrectErrorMessage() th
stubFor(post(urlEqualTo("/folders"))
.willReturn(aResponse()
.withStatus(409)
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(fakeJSONResponse.toString())));

BoxAPIRequest request = new BoxAPIRequest(api, foldersUrl(), "POST");
Expand Down Expand Up @@ -190,7 +190,7 @@ public void testResponseExceptionHeadersIsCaseInsensitive() {
}

@Test
public void testGetResponseHeadersWithNoRequestID() throws IOException {
public void testGetResponseHeadersWithNoRequestID() {
final String userURL = "/2.0/users/12345";

String result = TestUtils.getFixture("BoxException/BoxResponseException403");
Expand All @@ -211,7 +211,7 @@ public void testGetResponseHeadersWithNoRequestID() throws IOException {


@Test
public void testGetResponseExceptionCorrectlyWithAllID() throws IOException {
public void testGetResponseExceptionCorrectlyWithAllID() {
final String userURL = "/2.0/users/12345";

String result = TestUtils.getFixture("BoxException/BoxResponseException403WithRequestID");
Expand All @@ -231,7 +231,7 @@ public void testGetResponseExceptionCorrectlyWithAllID() throws IOException {
}

@Test
public void testGetResponseExceptionErrorAndErrorDescription() throws IOException {
public void testGetResponseExceptionErrorAndErrorDescription() {
final String userURL = "/2.0/users/12345";

String result = TestUtils.getFixture("BoxException/BoxResponseException400WithErrorAndErrorDescription");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static java.lang.String.format;

import com.eclipsesource.json.JsonObject;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import java.io.IOException;
import java.util.Iterator;
import org.junit.Assert;
import org.junit.Before;
Expand All @@ -26,7 +26,7 @@ public void setUpBaseUrl() {
}

@Test
public void testCreateAllowlistForAUserSucceedsAndSendsCorrectJson() throws IOException {
public void testCreateAllowlistForAUserSucceedsAndSendsCorrectJson() {
final String allowlistURL = "/2.0/collaboration_whitelist_exempt_targets";
final String userToAllowlistID = "1111";
final String userToAllowlistLogin = "test@user.com";
Expand All @@ -46,7 +46,7 @@ public void testCreateAllowlistForAUserSucceedsAndSendsCorrectJson() throws IOEx
wireMockRule.stubFor(WireMock.post(WireMock.urlPathEqualTo(allowlistURL))
.withRequestBody(WireMock.equalToJson(userOuterObject.toString()))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

BoxCollaborationAllowlistExemptTarget.Info userAllowlistInfo =
Expand All @@ -60,7 +60,7 @@ public void testCreateAllowlistForAUserSucceedsAndSendsCorrectJson() throws IOEx
}

@Test
public void testGetAllowlistInfoForAUser() throws IOException {
public void testGetAllowlistInfoForAUser() {
final String allowlistID = "12345";
final String allowlistURL = "/2.0/collaboration_whitelist_exempt_targets/" + allowlistID;
final String allowlistedUserID = "1111";
Expand All @@ -72,7 +72,7 @@ public void testGetAllowlistInfoForAUser() throws IOException {

wireMockRule.stubFor(WireMock.get(WireMock.urlPathEqualTo(allowlistURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

BoxCollaborationAllowlistExemptTarget.Info userAllowlistInfo = new
Expand All @@ -86,7 +86,7 @@ public void testGetAllowlistInfoForAUser() throws IOException {
}

@Test
public void testGetAllowlistInfoForAllUsers() throws IOException {
public void testGetAllowlistInfoForAllUsers() {
final String allowlistExemptUserURL = "/2.0/collaboration_whitelist_exempt_targets";
final String firstAllowlistType = "collaboration_whitelist_exempt_target";
final String firstAllowlistID = "1234";
Expand All @@ -95,7 +95,7 @@ public void testGetAllowlistInfoForAllUsers() throws IOException {

wireMockRule.stubFor(WireMock.get(WireMock.urlPathEqualTo(allowlistExemptUserURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

Iterator<BoxCollaborationAllowlistExemptTarget.Info> allowlistInfo =
Expand All @@ -114,7 +114,7 @@ public void testDeleteCollaborationAllowlistForUser() {

wireMockRule.stubFor(WireMock.delete(WireMock.urlPathEqualTo(deleteAllowlistURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withStatus(204)));

new BoxCollaborationAllowlistExemptTarget(this.api, allowlistID).delete();
Expand Down
16 changes: 8 additions & 8 deletions src/test/java/com/box/sdk/BoxCollaborationAllowlistTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.box.sdk;

import static com.box.sdk.http.ContentType.APPLICATION_JSON;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static java.lang.String.format;
import static org.junit.Assert.assertEquals;

import com.eclipsesource.json.JsonObject;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -35,14 +35,14 @@ public void testDeleteAllowlistForDomainSucceeds() {

wireMockRule.stubFor(WireMock.delete(WireMock.urlPathEqualTo(deleteAllowlistURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withStatus(204)));

new BoxCollaborationAllowlist(this.api, whitelistID).delete();
}

@Test
public void testGetAllowlistInfoForAllDomainsSucceeds() throws IOException {
public void testGetAllowlistInfoForAllDomainsSucceeds() {
final String whitelistURL = "/2.0/collaboration_whitelist_entries";
final String firstAllowlistID = "1111";
final String firstAllowlistDomain = "test.com";
Expand All @@ -52,7 +52,7 @@ public void testGetAllowlistInfoForAllDomainsSucceeds() throws IOException {

wireMockRule.stubFor(WireMock.get(WireMock.urlPathEqualTo(whitelistURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

Iterator<BoxCollaborationAllowlist.Info> iterator = BoxCollaborationAllowlist.getAll(this.api).iterator();
Expand All @@ -64,7 +64,7 @@ public void testGetAllowlistInfoForAllDomainsSucceeds() throws IOException {
}

@Test
public void testGetAllowlistInfoForADomainSucceeds() throws IOException {
public void testGetAllowlistInfoForADomainSucceeds() {
final String whitelistID = "12345";
final String getAllowlistInfoURL = "/2.0/collaboration_whitelist_entries/" + whitelistID;
final String whitelistDomain = "example.com";
Expand All @@ -74,7 +74,7 @@ public void testGetAllowlistInfoForADomainSucceeds() throws IOException {

wireMockRule.stubFor(WireMock.get(WireMock.urlPathEqualTo(getAllowlistInfoURL))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

BoxCollaborationAllowlist.Info whitelistInfo = new BoxCollaborationAllowlist(this.api, whitelistID).getInfo();
Expand All @@ -85,7 +85,7 @@ public void testGetAllowlistInfoForADomainSucceeds() throws IOException {
}

@Test
public void testCreateAllowlistForDomainSucceedsAndSendsCorrectJson() throws IOException {
public void testCreateAllowlistForDomainSucceedsAndSendsCorrectJson() {
final String whitelistURL = "/2.0/collaboration_whitelist_entries";
final String domainToAllowlist = "example.com";
final String whitelistDirection = "both";
Expand All @@ -102,7 +102,7 @@ public void testCreateAllowlistForDomainSucceedsAndSendsCorrectJson() throws IOE
wireMockRule.stubFor(WireMock.post(WireMock.urlPathEqualTo(whitelistURL))
.withRequestBody(WireMock.equalToJson(whitelistObject.toString()))
.willReturn(WireMock.aResponse()
.withHeader("Content-Type", "application/json")
.withHeader("Content-Type", APPLICATION_JSON)
.withBody(result)));

BoxCollaborationAllowlist.Info collabAllowlistInfo = BoxCollaborationAllowlist.create(this.api,
Expand Down
Loading