What object can I pass to QueryResults.asModel() so when I test a method that runs the line:
final var model = QueryResults.asModel(result);
result has at least one Statement and asModel finishes correctly and returns what I set in the test?
when(queryResults.asModel(graphQueryResult)).thenReturn(model);
Would this example help?
Of course, it is possible to mock the result of
QueryResults.asModel
, but as it is a third-party code, it is generally advised to use it rather than mocking it.Note that some of the types in the example are deprecated as of RDF4J 4.1.0, so they may not exist in the upcoming 5.0.0 release of RDF4J.