Make TestExecutionResult package private
This commit is contained in:
@@ -26,14 +26,18 @@ import graphql.ExecutionResult;
|
||||
import graphql.ExecutionResultImpl;
|
||||
import graphql.GraphQLError;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* {@link GraphQLError} with setters for deserialization.
|
||||
* {@link GraphQLError} with setters, for internal use to use to deserialize
|
||||
* from a response.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class TestExecutionResult implements ExecutionResult {
|
||||
final class TestExecutionResult implements ExecutionResult {
|
||||
|
||||
@Nullable
|
||||
private Object data;
|
||||
|
||||
private List<GraphQLError> errors = Collections.emptyList();
|
||||
@@ -46,6 +50,7 @@ public class TestExecutionResult implements ExecutionResult {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
public <T> T getData() {
|
||||
return (T) this.data;
|
||||
}
|
||||
@@ -75,7 +80,8 @@ public class TestExecutionResult implements ExecutionResult {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toSpecification() {
|
||||
ExecutionResultImpl.Builder builder = ExecutionResultImpl.newExecutionResult().addErrors(this.errors)
|
||||
ExecutionResultImpl.Builder builder = ExecutionResultImpl.newExecutionResult()
|
||||
.addErrors(this.errors)
|
||||
.extensions(this.extensions);
|
||||
|
||||
if (isDataPresent()) {
|
||||
|
||||
@@ -30,12 +30,13 @@ import graphql.language.SourceLocation;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* {@link GraphQLError} with setters to use for deserialization.
|
||||
* {@link GraphQLError} with setters, for internal use to use to deserialize
|
||||
* from a response.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
class TestGraphQlError implements GraphQLError {
|
||||
final class TestGraphQlError implements GraphQLError {
|
||||
|
||||
@Nullable
|
||||
private String message;
|
||||
|
||||
@@ -24,13 +24,14 @@ import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.core.ResolvableType;
|
||||
|
||||
/**
|
||||
* {@link TypeRef} with a {@link #getType() type} that is given rather than obtained from
|
||||
* the declared generic type information.
|
||||
* Adapter for a JSONPath {@link TypeRef} with a {@link #getType() type} that
|
||||
* returns fixed type information rather than obtained from the generic type
|
||||
* declaration.
|
||||
*
|
||||
* @param <T> the referenced type
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
class TypeRefAdapter<T> extends TypeRef<T> {
|
||||
final class TypeRefAdapter<T> extends TypeRef<T> {
|
||||
|
||||
private final Type type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user