diff --git a/spring-graphql-test/src/main/java/org/springframework/graphql/test/tester/WebTestClientRequestStrategy.java b/spring-graphql-test/src/main/java/org/springframework/graphql/test/tester/WebTestClientRequestStrategy.java index 5706c74f..59c7ff98 100644 --- a/spring-graphql-test/src/main/java/org/springframework/graphql/test/tester/WebTestClientRequestStrategy.java +++ b/spring-graphql-test/src/main/java/org/springframework/graphql/test/tester/WebTestClientRequestStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ final class WebTestClientRequestStrategy extends RequestStrategySupport implemen .expectStatus() .isOk() .expectHeader() - .contentType(MediaType.APPLICATION_JSON) + .contentTypeCompatibleWith(MediaType.APPLICATION_JSON) .expectBody() .returnResult(); diff --git a/spring-graphql-test/src/test/java/org/springframework/graphql/test/tester/WebGraphQlTesterTests.java b/spring-graphql-test/src/test/java/org/springframework/graphql/test/tester/WebGraphQlTesterTests.java index c4d9e7f0..8f3fb893 100644 --- a/spring-graphql-test/src/test/java/org/springframework/graphql/test/tester/WebGraphQlTesterTests.java +++ b/spring-graphql-test/src/test/java/org/springframework/graphql/test/tester/WebGraphQlTesterTests.java @@ -211,7 +211,7 @@ public class WebGraphQlTesterTests { sb.append("}"); MockResponse response = new MockResponse(); - response.setHeader("Content-Type", "application/json"); + response.setHeader("Content-Type", "application/json;charset=UTF-8"); // charset should be ignored if present response.setBody(sb.toString()); this.server.enqueue(response);