Skip to content

Commit e1ba76c

Browse files
committed
Fix failing tests
1 parent 9c317e7 commit e1ba76c

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/main/java/graphql/servlet/GraphQLServlet.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public GraphQLServlet(ObjectMapperConfigurer objectMapperConfigurer, List<GraphQ
178178
};
179179
}
180180

181-
private ObjectMapper getMapper() {
181+
protected ObjectMapper getMapper() {
182182
return lazyObjectMapperBuilder.getMapper();
183183
}
184184

@@ -343,15 +343,9 @@ private <T> void runCallbacks(List<T> callbacks, Consumer<T> action) {
343343

344344
protected static class VariablesDeserializer extends JsonDeserializer<Map<String, Object>> {
345345

346-
private final ObjectMapper mapper;
347-
348-
public VariablesDeserializer(@JacksonInject ObjectMapper mapper) {
349-
this.mapper = mapper;
350-
}
351-
352346
@Override
353347
public Map<String, Object> deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
354-
return deserializeVariablesObject(p.readValueAs(Object.class), mapper);
348+
return deserializeVariablesObject(p.readValueAs(Object.class), (ObjectMapper) ctxt.findInjectableValue(ObjectMapper.class.getName(), null, null));
355349
}
356350
}
357351

src/test/groovy/graphql/servlet/GraphQLServletSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,6 @@ class GraphQLServletSpec extends Specification {
407407

408408
def "typeInfo is serialized correctly"() {
409409
expect:
410-
GraphQLServlet.mapper.writeValueAsString(ExecutionTypeInfo.newTypeInfo().type(new GraphQLNonNull(Scalars.GraphQLString)).build()) != "{}"
410+
servlet.getMapper().writeValueAsString(ExecutionTypeInfo.newTypeInfo().type(new GraphQLNonNull(Scalars.GraphQLString)).build()) != "{}"
411411
}
412412
}

0 commit comments

Comments
 (0)