QueryService { public QueryResponse getSqlQuery(PartialRequest partialRequest) { try { String sqlStatements = opaClientService.getExecutableSqlStatements(convertToOpaPartialRequest(partialRequest)); QueryResponse queryResponse = new QueryResponse(); queryResponse.setResult(sqlStatements); return queryResponse; } catch (OpaClientException e) { throw new OpaClientException(e.getMessage()); } } @SuppressWarnings("rawtypes")  QueryService(OpaClientService opaClientService, MongoQueryService mongoQueryService, ModelMapper modelMapper); QueryResponse getSqlQuery(PartialRequest partialRequest); QueryResponse getMongoDbQuery(PartialRequest partialRequest);  }
@Test void shouldReturnSqlQuery() { opa.datafilter.core.ast.db.query.model.request.PartialRequest opaPartialRequest = new opa.datafilter.core.ast.db.query.model.request.PartialRequest(); when(opaClientService.getExecutableSqlStatements(opaPartialRequest)).thenReturn("SELECT * from pets WHERE pets.name == 'fluffy'"); QueryResponse result = target.getSqlQuery(new PartialRequest()); assertThat(result, is(notNullValue())); }