forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
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 quarkusio#20450 from jmartisk/smallrye-graphql-1.3.4
SmallRye GraphQL 1.3.4
- Loading branch information
Showing
7 changed files
with
89 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
19 changes: 19 additions & 0 deletions
19
...s/smallrye-graphql/src/main/java/io/quarkus/it/smallrye/graphql/FaultTolerantService.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,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) { | ||
} | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
integration-tests/smallrye-graphql/src/main/resources/application.properties
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
message=Production | ||
message=Production | ||
quarkus.smallrye-graphql.show-runtime-exception-message=org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException |
8 changes: 8 additions & 0 deletions
8
...lrye-graphql/src/test/java/io/quarkus/it/smallrye/graphql/GraphQLAndFaultToleranceIT.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,8 @@ | ||
package io.quarkus.it.smallrye.graphql; | ||
|
||
import io.quarkus.test.junit.NativeImageTest; | ||
|
||
@NativeImageTest | ||
public class GraphQLAndFaultToleranceIT extends GraphQLAndFaultToleranceTest { | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...ye-graphql/src/test/java/io/quarkus/it/smallrye/graphql/GraphQLAndFaultToleranceTest.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,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")); | ||
} | ||
} |