-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30227 from jmartisk/main-srgql-1.9.1-and-issue-30119
SmallRye GraphQL 1.9.1/2.0.1 + config property to control Federation
- Loading branch information
Showing
5 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...t/src/test/java/io/quarkus/smallrye/graphql/deployment/GraphQLFederationDisabledTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package io.quarkus.smallrye.graphql.deployment; | ||
|
||
import static org.hamcrest.Matchers.*; | ||
import static org.hamcrest.Matchers.containsString; | ||
|
||
import org.eclipse.microprofile.graphql.GraphQLApi; | ||
import org.eclipse.microprofile.graphql.Query; | ||
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
import io.restassured.RestAssured; | ||
|
||
/** | ||
* Make sure that if no Federation related annotations are in the application, then Federation is | ||
* disabled (unless explicitly enabled in the config). | ||
*/ | ||
public class GraphQLFederationDisabledTest extends AbstractGraphQLTest { | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(FooApi.class, Foo.class) | ||
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")); | ||
|
||
@Test | ||
public void checkSchemaDoesNotIncludeServiceDeclaration() { | ||
RestAssured.given() | ||
.get("/graphql/schema.graphql") | ||
.then() | ||
.body(not(containsString("type _Service {"))); | ||
} | ||
|
||
@GraphQLApi | ||
static class FooApi { | ||
|
||
@Query | ||
public Foo foo() { | ||
return new Foo(); | ||
} | ||
|
||
} | ||
|
||
static class Foo { | ||
|
||
public String name; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters