In a quarkus project with quarkus-smallrye-graphql lib, is there a way to unit test a GraphQL resource object like this one :
@GraphQLApi
public class ProductResource {
@Inject
private ProductRepository productRepository;
@Query("products")
@Description("Get all Products")
@RolesAllowed({"USER","ADMIN"})
public List<Product> findAll() {
return this.productRepository.findAll().list();
}
@Mutation
@Description("Create a new Product")
@RolesAllowed("ADMIN")
public Boolean createProduct(String name, Double price) {
return this.productRepository.createProduct(name, price);
}
}
I want to be able to send a GraphQL query (with Authentication inactivated/or not) in unit testing in order to validate my annotations but I don't find any documented way to do it.