Extract RequestOutput base class

See gh-229
This commit is contained in:
rstoyanchev
2022-01-07 16:07:11 +00:00
parent 44efeb6473
commit c84f342daf
13 changed files with 148 additions and 88 deletions

View File

@@ -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.
@@ -36,6 +36,7 @@ import reactor.core.publisher.Mono;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.graphql.GraphQlService;
import org.springframework.graphql.RequestInput;
import org.springframework.graphql.RequestOutput;
import org.springframework.lang.Nullable;
import org.springframework.util.CollectionUtils;
@@ -351,8 +352,9 @@ public class GraphQlTesterTests {
if (!CollectionUtils.isEmpty(errors)) {
builder.addErrors(errors);
}
RequestInput input = new RequestInput("{}", null, null, null, "1");
ExecutionResult result = builder.build();
given(this.service.execute(this.inputCaptor.capture())).willReturn(Mono.just(result));
given(this.service.execute(this.inputCaptor.capture())).willReturn(Mono.just(new RequestOutput(input, result)));
}
}