use of com.example.graphql.client.betterbotz.atomic.InsertOrdersWithAtomicMutation in project stargate by stargate.
the class AtomicDirectiveTest method shouldSupportSingleMutationWithAtomicDirective.
@Test
@DisplayName("Should execute single mutation with atomic directive")
public void shouldSupportSingleMutationWithAtomicDirective() {
UUID id = UUID.randomUUID();
String productName = "prod " + id;
String description = "desc " + id;
String customer = "cust 1";
ApolloClient client = getApolloClient("/graphql/" + keyspace);
InsertOrdersWithAtomicMutation mutation = InsertOrdersWithAtomicMutation.builder().value(OrdersInput.builder().prodName(productName).customerName(customer).price("456").description(description).build()).build();
getObservable(client.mutate(mutation));
assertThat(session.execute(SimpleStatement.newInstance("SELECT * FROM \"Orders\" WHERE \"prodName\" = ?", productName)).one()).isNotNull().extracting(r -> r.getString("\"customerName\""), r -> r.getString("description")).containsExactly(customer, description);
}
Aggregations