Skip to content

Commit

Permalink
smallrye#521: add TCK tests & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
t1 authored and jmartisk committed Oct 3, 2022
1 parent eb72c0e commit 76c4a8b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 116 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public ExecutionResponse(ExecutionResult executionResult) {
this.executionResult = executionResult;
}

public String toString() {
return "ExecutionResponse->" + executionResult;
}

public ExecutionResult getExecutionResult() {
return this.executionResult;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.jboss.shrinkwrap.resolver.api.maven.Maven;

import io.smallrye.graphql.api.Entry;
import io.smallrye.graphql.api.federation.Key;
import io.smallrye.graphql.test.apps.adapt.to.api.AdaptToResource;
import io.smallrye.graphql.test.apps.adapt.with.api.AdapterResource;
import io.smallrye.graphql.test.apps.async.api.AsyncApi;
Expand All @@ -23,6 +24,7 @@
import io.smallrye.graphql.test.apps.enumlist.api.EnumListApi;
import io.smallrye.graphql.test.apps.error.api.ErrorApi;
import io.smallrye.graphql.test.apps.exceptionlist.ExceptionListApi;
import io.smallrye.graphql.test.apps.federation.ProductApi;
import io.smallrye.graphql.test.apps.fieldexistence.api.FieldExistenceApi;
import io.smallrye.graphql.test.apps.generics.api.ControllerWithGenerics;
import io.smallrye.graphql.test.apps.grouping.api.BookGraphQLApi;
Expand Down Expand Up @@ -90,6 +92,8 @@ public void process(Archive<?> applicationArchive, TestClass testClass) {

// For our auto Map adaption
war.addPackage(Entry.class.getPackage());
// For the federation directives
war.addPackage(Key.class.getPackage());
// Add our own test app
war.addPackage(ProfileGraphQLApi.class.getPackage());
war.addPackage(AdditionalScalarsApi.class.getPackage());
Expand All @@ -116,6 +120,7 @@ public void process(Archive<?> applicationArchive, TestClass testClass) {
war.addPackage(NonNullClass.class.getPackage());
war.addPackage(NonNullPackageClass.class.getPackage());
war.addPackage(StocksApi.class.getPackage());
war.addPackage(ProductApi.class.getPackage());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.graphql.test.apps.federation.product.api;
package io.smallrye.graphql.test.apps.federation;

import org.eclipse.microprofile.graphql.Id;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.smallrye.graphql.test.apps.federation.product.api;
package io.smallrye.graphql.test.apps.federation;

import static java.util.Arrays.asList;

Expand All @@ -9,7 +9,7 @@
import org.eclipse.microprofile.graphql.Query;

@GraphQLApi
public class Products {
public class ProductApi {
private static final List<Product> PRODUCTS = asList(
Product.product("1", "Armchair"),
Product.product("2", "Table"));
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ smallrye.graphql.logPayload=true
mp.graphql.showErrorMessage=java.security.AccessControlException,io.smallrye.graphql.test.apps.exceptionlist.*
mp.graphql.hideErrorMessage=java.io.IOException,io.smallrye.graphql.test.apps.exceptionlist.*
smallrye.graphql.errorExtensionFields=exception,classification,code,description,validationErrorType,queryPath
smallrye.graphql.parser.capture.sourceLocation=false
smallrye.graphql.parser.capture.sourceLocation=false
smallrye.graphql.federation.enabled=true
18 changes: 11 additions & 7 deletions server/tck/src/test/resources/tests/federation/input.graphql
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
deepList{
names
query product {
_entities(representations: [{
__typename: "Product",
id: "1"
}]) {
... on Product {
__typename
name
id
}
}
deepListFoo{
bar
}
}
}
27 changes: 7 additions & 20 deletions server/tck/src/test/resources/tests/federation/output.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
{
"data": {
"deepList": [
[
[
{
"names": [
"Phillip"
]
}
]
]
],
"deepListFoo": [
[
[
{
"bar": "bar"
}
]
]
"_entities": [
{
"__typename": "Product",
"name": "Armchair",
"id": "1"
}
]
}
}
}

0 comments on commit 76c4a8b

Please sign in to comment.