Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 8cb1f8a

Browse files
authored
Merge pull request #257 from blaugold/GraphQLResponse-empty-body
feat(): improve error message when body empty in GraphQLResponse
2 parents 87b0c44 + d6ff642 commit 8cb1f8a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graphql-spring-boot-test/src/main/java/com/graphql/spring/boot/test/GraphQLResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public class GraphQLResponse {
1919
public GraphQLResponse(ResponseEntity<String> responseEntity) {
2020
this.responseEntity = Objects.requireNonNull(responseEntity);
2121
this.mapper = new ObjectMapper();
22+
23+
Objects.requireNonNull(responseEntity.getBody(),
24+
() -> "Body is empty with status " + responseEntity.getStatusCodeValue());
2225
context = JsonPath.parse(responseEntity.getBody());
2326
}
2427

0 commit comments

Comments
 (0)