Mockito argument-matchers for GraphQL.
Features:
- query
- name
- arguments
- mutation
- name
- arguments
The library is primarily intended for mocking proxied GraphQL service implementations, i.e. without needing the whole payload.
The project is built with Maven and is available on the central Maven repository.
Maven coordinates
Add the property
<mockito-graphql-matchers.version>1.0.0</mockito-graphql-matchers.version>
then add
<dependency>
<groupId>com.github.skjolber.mockito.graphql</groupId>
<artifactId>matchers</artifactId>
<version>${mockito-graphql-matchers.version}</version>
</dependency>
or
Gradle coordinates
For
ext {
mockitoGraphqlMatchersVersion = '1.0.0'
}
add
api ("com.github.skjolber.mockito.graphql:matchers:${mockitoGraphqlMatchersVersion}")
Add import
import static com.github.skjolber.mockito.graphql.matchers.ArgumentMatchers.*;
then start mocking
when(http.exchange(queryName("getUser"))).thenReturn("{ ... user response ... }");
when(http.exchange(queryName("getTickets"))).thenReturn("{ ... tickets response ... }");
so to emulate more complex mock GraphQL service behaviors.
- 1.0.0: Initial release.