Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmallRye GraphQL 1.3.4 #20450

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<smallrye-health.version>3.1.1</smallrye-health.version>
<smallrye-metrics.version>3.0.1</smallrye-metrics.version>
<smallrye-open-api.version>2.1.15</smallrye-open-api.version>
<smallrye-graphql.version>1.3.3</smallrye-graphql.version>
<smallrye-graphql.version>1.3.4</smallrye-graphql.version>
<smallrye-opentracing.version>2.0.1</smallrye-opentracing.version>
<smallrye-fault-tolerance.version>5.2.1</smallrye-fault-tolerance.version>
<smallrye-jwt.version>3.3.0</smallrye-jwt.version>
Expand Down
17 changes: 17 additions & 0 deletions integration-tests/smallrye-graphql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-graphql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-fault-tolerance</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
Expand All @@ -46,6 +50,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-fault-tolerance-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.quarkus.it.smallrye.graphql;

import java.util.concurrent.TimeUnit;

import javax.inject.Singleton;

import org.eclipse.microprofile.faulttolerance.Timeout;

@Singleton
public class FaultTolerantService {

@Timeout(10)
public void causeTimeout() {
try {
TimeUnit.MILLISECONDS.sleep(2500);
} catch (InterruptedException e) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.util.Collection;
import java.util.List;

import javax.inject.Inject;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.graphql.GraphQLApi;
import org.eclipse.microprofile.graphql.Mutation;
Expand Down Expand Up @@ -52,4 +54,13 @@ public Collection<Greeting> buildInOptionsCollection(@Source Greeting greeting)
public Farewell farewell() {
return new Farewell();
}

@Inject
FaultTolerantService service;

@Query
public String faultTolerance() {
service.causeTimeout();
return "PASSED";
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
message=Production
message=Production
quarkus.smallrye-graphql.show-runtime-exception-message=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package io.quarkus.it.smallrye.graphql;

import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class GraphQLAndFaultToleranceIT extends GraphQLAndFaultToleranceTest {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.it.smallrye.graphql;

import static io.quarkus.it.smallrye.graphql.PayloadCreator.MEDIATYPE_JSON;
import static io.quarkus.it.smallrye.graphql.PayloadCreator.getPayload;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class GraphQLAndFaultToleranceTest {

@Test
public void testGraphQLAndFaultToleranceTogether() {
String helloRequest = getPayload("{\n" +
" faultTolerance\n" +
"}");

given()
.when()
.accept(MEDIATYPE_JSON)
.contentType(MEDIATYPE_JSON)
.body(helloRequest)
.post("/graphql")
.then()
.statusCode(200)
.body("errors[0].message", containsString("Timeout"));
}
}