Skip to content

Commit a8ba651

Browse files
committed
adjust error handling tests
1 parent 16375db commit a8ba651

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/test/java/com/cloudconvert/test/integration/AsyncCloudConvertClientExceptionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void unauthorized() throws Exception {
4646

4747
assertThat(cloudConvertClientException.getStatus().getCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED);
4848
assertThat(cloudConvertClientException.getStatus().getReason()).isEqualTo("Unauthorized");
49-
assertThat(cloudConvertClientException.getHeaders()).hasSize(6);
49+
assertThat(cloudConvertClientException.getHeaders()).containsKey("Content-Type");
5050
assertThat(cloudConvertClientException.getBody().getCode()).isEqualTo("UNAUTHENTICATED");
5151
assertThat(cloudConvertClientException.getBody().getMessage()).isEqualTo("Unauthenticated.");
5252
}
@@ -58,10 +58,10 @@ public void unprocessableEntity() throws Exception {
5858

5959
assertThat(cloudConvertClientException.getStatus().getCode()).isEqualTo(HttpStatus.SC_UNPROCESSABLE_ENTITY);
6060
assertThat(cloudConvertClientException.getStatus().getReason()).isEqualTo("Unprocessable Entity");
61-
assertThat(cloudConvertClientException.getHeaders()).hasSize(8);
61+
assertThat(cloudConvertClientException.getHeaders()).containsKey("Content-Type");
6262
assertThat(cloudConvertClientException.getBody().getCode()).isEqualTo("INVALID_DATA");
6363
assertThat(cloudConvertClientException.getBody().getMessage()).isEqualTo("The given data was invalid.");
64-
assertThat(cloudConvertClientException.getBody().getErrors()).hasSize(1);
64+
assertThat(cloudConvertClientException.getBody().getErrors()).containsKey("tasks");
6565
}
6666

6767
@After

src/test/java/com/cloudconvert/test/integration/CloudConvertClientExceptionTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void unauthorized() throws Exception {
4646

4747
assertThat(cloudConvertClientException.getStatus().getCode()).isEqualTo(HttpStatus.SC_UNAUTHORIZED);
4848
assertThat(cloudConvertClientException.getStatus().getReason()).isEqualTo("Unauthorized");
49-
assertThat(cloudConvertClientException.getHeaders()).hasSize(6);
49+
assertThat(cloudConvertClientException.getHeaders()).containsKey("Content-Type");
5050
assertThat(cloudConvertClientException.getBody().getCode()).isEqualTo("UNAUTHENTICATED");
5151
assertThat(cloudConvertClientException.getBody().getMessage()).isEqualTo("Unauthenticated.");
5252
}
@@ -58,10 +58,10 @@ public void unprocessableEntity() throws Exception {
5858

5959
assertThat(cloudConvertClientException.getStatus().getCode()).isEqualTo(HttpStatus.SC_UNPROCESSABLE_ENTITY);
6060
assertThat(cloudConvertClientException.getStatus().getReason()).isEqualTo("Unprocessable Entity");
61-
assertThat(cloudConvertClientException.getHeaders()).hasSize(8);
61+
assertThat(cloudConvertClientException.getHeaders()).containsKey("Content-Type");
6262
assertThat(cloudConvertClientException.getBody().getCode()).isEqualTo("INVALID_DATA");
6363
assertThat(cloudConvertClientException.getBody().getMessage()).isEqualTo("The given data was invalid.");
64-
assertThat(cloudConvertClientException.getBody().getErrors()).hasSize(1);
64+
assertThat(cloudConvertClientException.getBody().getErrors()).containsKey("tasks");
6565
}
6666

6767
@After

0 commit comments

Comments
 (0)