-
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.
Fixed an issue where annotations were not part of the Jandex index, i…
…f given in an external JAR
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
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
53 changes: 53 additions & 0 deletions
53
...us/smallrye/graphql/client/deployment/TypesafeGraphQLClientAsAnOutsideDependencyTest.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,53 @@ | ||
package io.quarkus.smallrye.graphql.client.deployment; | ||
|
||
import io.quarkus.smallrye.graphql.client.deployment.model.Person; | ||
import io.quarkus.smallrye.graphql.client.deployment.model.PersonDto; | ||
import io.quarkus.smallrye.graphql.client.deployment.model.TestingGraphQLApi; | ||
import io.quarkus.smallrye.graphql.client.deployment.model.TestingGraphQLClientApiWithNoConfigKey; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
import jakarta.inject.Inject; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
import org.jboss.shrinkwrap.api.asset.StringAsset; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
|
||
public class TypesafeGraphQLClientAsAnOutsideDependencyTest { | ||
|
||
|
||
static String url = "http://" + System.getProperty("quarkus.http.host", "localhost") + ":" + | ||
System.getProperty("quarkus.http.test-port", "8081") + "/graphql"; | ||
|
||
static JavaArchive dependency = ShrinkWrap.create(JavaArchive.class) | ||
.addClasses(TestingGraphQLClientApiWithNoConfigKey.class, Person.class); | ||
|
||
@RegisterExtension | ||
static QuarkusUnitTest test = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addClasses(PersonDto.class, TestingGraphQLApi.class) | ||
.addAsResource( | ||
new StringAsset( | ||
"quarkus.smallrye-graphql-client.\"io.quarkus.smallrye.graphql." + | ||
"client.deployment.model.TestingGraphQLClientApiWithNoConfigKey\".url=" | ||
+ url), | ||
"application.properties") | ||
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")) | ||
.addAdditionalDependency(dependency); | ||
@Inject | ||
TestingGraphQLClientApiWithNoConfigKey client; | ||
|
||
@Test | ||
public void performQuery() { | ||
List<Person> people = client.people(); | ||
assertEquals(2, people.size()); | ||
assertEquals("John", people.get(0).getFirstName()); | ||
assertEquals("Arthur", people.get(1).getFirstName()); | ||
} | ||
|
||
} |