@Target(value=TYPE)
@Retention(value=RUNTIME)
@OverrideAutoConfiguration(enabled=false)
@SpringBootTest(webEnvironment=RANDOM_PORT)
@ActiveProfiles
@ComponentScan
@ImportAutoConfiguration
public @interface GraphQLTest
@RunWith(SpringRunner.class) for running tests that focus only on
GraphQL components.
Provides the following features over the regular Spring TestContext Framework:
random port.@Component,
@Service or @Repository beans). See includeFilters() for a complete list of classes
that are included.GraphQLTestTemplate bean for use
in GraphQL tests that are using a fully running web server.GraphQLTest is used in combination with
@MockBean or
@Import to create any collaborators required by your
GraphQLResolver beans.
If you are looking to load your full application configuration and use
GraphQLTestTemplate you should consider
@SpringBootTest rather than this annotation.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
classes |
org.springframework.context.annotation.ComponentScan.Filter[] |
includeFilters |
java.lang.String[] |
profiles |
boolean |
useDefaultFilters |
java.lang.String[] |
value |
org.springframework.boot.test.context.SpringBootTest.WebEnvironment |
webEnvironment |
@AliasFor(annotation=org.springframework.test.context.ActiveProfiles.class) public abstract java.lang.String[] profiles
@AliasFor(annotation=org.springframework.boot.test.context.SpringBootTest.class) public abstract org.springframework.boot.test.context.SpringBootTest.WebEnvironment webEnvironment
@AliasFor(annotation=org.springframework.boot.autoconfigure.ImportAutoConfiguration.class) public abstract java.lang.Class<?>[] classes
@AliasFor(annotation=org.springframework.context.annotation.ComponentScan.class) public abstract boolean useDefaultFilters
@AliasFor(annotation=org.springframework.context.annotation.ComponentScan.class) public abstract org.springframework.context.annotation.ComponentScan.Filter[] includeFilters