QueryService { public QueryResponse getMongoDbQuery(PartialRequest partialRequest) { Query mongoDBQuery = mongoQueryService.getMongoDBQuery(convertToOpaPartialRequest(partialRequest)); QueryResponse queryResponse = new QueryResponse(); queryResponse.setResult(mongoDBQuery.getQueryObject().toJson()); return queryResponse; } @SuppressWarnings("rawtypes")  QueryService(OpaClientService opaClientService, MongoQueryService mongoQueryService, ModelMapper modelMapper); QueryResponse getSqlQuery(PartialRequest partialRequest); QueryResponse getMongoDbQuery(PartialRequest partialRequest);  }
@Test void shouldReturnMongoDbQuery() { opa.datafilter.core.ast.db.query.model.request.PartialRequest opaPartialRequest = new opa.datafilter.core.ast.db.query.model.request.PartialRequest(); BasicQuery query = new BasicQuery("{ age : { $lt : 50 }, balance : { $gt : 1000.00 }}"); when(mongoQueryService.getMongoDBQuery(opaPartialRequest)).thenReturn(query); QueryResponse result = target.getMongoDbQuery(new PartialRequest()); assertThat(result, is(notNullValue())); }