use of com.graphql_java_generator.domain.client.allGraphQLCases.CharacterInput in project graphql-maven-plugin-project by graphql-java-generator.
the class GraphQLTwoRepositoriesSpringIntegrationTest method testInvoke_allGraphQLCases_withOneOptionalParam.
@SuppressWarnings("unchecked")
@Test
@Execution(ExecutionMode.CONCURRENT)
void testInvoke_allGraphQLCases_withOneOptionalParam() throws GraphQLRequestExecutionException, GraphQLRequestPreparationException, NoSuchMethodException, SecurityException {
// Preparation
CharacterInput input = new CharacterInput();
Human h = Human.builder().withId("1").withHomePlanet("home planet").withName(" a name ").build();
doReturn(h).when(spyQueryExecutor).withOneOptionalParamWithBindValues(any(ObjectResponse.class), any(CharacterInput.class), any(Map.class));
// Go, go, go
Character verif = graphQLAllGraphQLCasesRepo.withOneOptionalParam(input);
// Verification
assertEquals(h, verif);
assertEquals(//
"{appearsIn name}", GraphQLRepositoryTestHelper.getRegisteredGraphQLRequest(invocationHandlerAllGraphQLCases, GraphQLTwoRepositoriesAllGraphQlCasesTestCase.class, "withOneOptionalParam", CharacterInput.class));
}
use of com.graphql_java_generator.domain.client.allGraphQLCases.CharacterInput in project graphql-maven-plugin-project by graphql-java-generator.
the class GraphQLRepositorySpringIntegrationTest method testInvoke_partialRequest_noRequestName_withObjectArray.
@SuppressWarnings("unchecked")
@Test
@Execution(ExecutionMode.CONCURRENT)
void testInvoke_partialRequest_noRequestName_withObjectArray() throws GraphQLRequestExecutionException, GraphQLRequestPreparationException, NoSuchMethodException, SecurityException {
// Preparation
CharacterInput input = new CharacterInput();
Human h = Human.builder().withId("1").withHomePlanet("home planet").withName(" a name ").build();
doReturn(h).when(spyQueryExecutor).withOneOptionalParamWithBindValues(any(ObjectResponse.class), any(CharacterInput.class), any(Map.class));
// Go, go, go
Character verif = graphQLRepository.withOneOptionalParam(input);
// Verification
assertEquals(h, verif);
assertEquals(//
"{appearsIn name}", GraphQLRepositoryTestHelper.getRegisteredGraphQLRequest(invocationHandler, GraphQLRepositoryTestCase.class, "withOneOptionalParam", CharacterInput.class));
}
use of com.graphql_java_generator.domain.client.allGraphQLCases.CharacterInput in project graphql-maven-plugin-project by graphql-java-generator.
the class AbstractGraphQLRepositoryInvocationHandlerTest method testInvoke_partialRequest_withRequestName_withoutObjectArray.
@SuppressWarnings("unchecked")
@Test
void testInvoke_partialRequest_withRequestName_withoutObjectArray() throws GraphQLRequestExecutionException, NoSuchMethodException, SecurityException {
// Preparation
CharacterInput input = new CharacterInput();
Human h = Human.builder().withId("1").withHomePlanet("home planet").withName(" a name ").build();
doReturn(h).when(spyQueryExecutor).withOneOptionalParamWithBindValues(any(ObjectResponse.class), any(CharacterInput.class), any(Map.class));
// Go, go, go
Character verif = graphQLRepository.thisIsNotARequestName2(input);
// Verification
assertEquals(h, verif);
assertEquals("{id name appearsIn}", GraphQLRepositoryTestHelper.getRegisteredGraphQLRequest(invocationHandler, GraphQLRepositoryTestCase.class, "thisIsNotARequestName2", CharacterInput.class));
}
use of com.graphql_java_generator.domain.client.allGraphQLCases.CharacterInput in project graphql-maven-plugin-project by graphql-java-generator.
the class AbstractGraphQLRepositoryInvocationHandlerTest method testInvoke_partialRequest_withRequestName_withObjectArray.
/**
* with requestName: the method name is the field name of the query type in the GraphQL schema
*/
@SuppressWarnings("unchecked")
@Test
void testInvoke_partialRequest_withRequestName_withObjectArray() throws GraphQLRequestExecutionException, GraphQLRequestPreparationException, NoSuchMethodException, SecurityException {
// Preparation
CharacterInput input = new CharacterInput();
Human h = Human.builder().withId("1").withHomePlanet("home planet").withName(" a name ").build();
doReturn(h).when(spyQueryExecutor).withOneOptionalParamWithBindValues(any(ObjectResponse.class), any(CharacterInput.class), any(Map.class));
// Go, go, go
Character verif = graphQLRepository.thisIsNotARequestName1(input);
// Verification
assertEquals(h, verif);
assertEquals("{appearsIn name id}", GraphQLRepositoryTestHelper.getRegisteredGraphQLRequest(invocationHandler, GraphQLRepositoryTestCase.class, "thisIsNotARequestName1", CharacterInput.class));
}
use of com.graphql_java_generator.domain.client.allGraphQLCases.CharacterInput in project graphql-maven-plugin-project by graphql-java-generator.
the class AbstractGraphQLRepositoryInvocationHandlerTest method testInvoke_partialRequest_noRequestName_withObjectArray.
/**
* no requestName: the method name is the field name of the query type in the GraphQL schema
*/
@SuppressWarnings("unchecked")
@Test
void testInvoke_partialRequest_noRequestName_withObjectArray() throws GraphQLRequestExecutionException, GraphQLRequestPreparationException, NoSuchMethodException, SecurityException {
// Preparation
CharacterInput input = new CharacterInput();
Human h = Human.builder().withId("1").withHomePlanet("home planet").withName(" a name ").build();
doReturn(h).when(spyQueryExecutor).withOneOptionalParamWithBindValues(any(ObjectResponse.class), any(CharacterInput.class), any(Map.class));
// Go, go, go
Character verif = graphQLRepository.withOneOptionalParam(input);
// Verification
assertEquals(h, verif);
assertEquals("{appearsIn name}", GraphQLRepositoryTestHelper.getRegisteredGraphQLRequest(invocationHandler, GraphQLRepositoryTestCase.class, "withOneOptionalParam", CharacterInput.class));
}
Aggregations