File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/test/java/com/intuit/graphql/orchestrator/testhelpers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1212import java .util .Map ;
1313import java .util .Set ;
1414import java .util .concurrent .CompletableFuture ;
15+ import org .apache .commons .collections4 .MapUtils ;
1516
1617public class MockServiceProvider implements ServiceProvider {
1718
@@ -52,7 +53,11 @@ public ServiceType getSeviceType() {
5253 @ Override
5354 public CompletableFuture <Map <String , Object >> query (ExecutionInput executionInput ,
5455 GraphQLContext context ) {
55- return CompletableFuture .completedFuture (this .responseMap .get (executionInput .getQuery ()));
56+ Map <String , Object > data = this .responseMap .get (executionInput .getQuery ());
57+ if (MapUtils .isEmpty (data )) {
58+ throw new IllegalArgumentException ("Mock response not found for query: " + executionInput .getQuery ());
59+ }
60+ return CompletableFuture .completedFuture (data );
5661 }
5762
5863 public static Builder builder () {
You can’t perform that action at this time.
0 commit comments