AstToSql { public String getSqlQueryStatements(PartialRequest partialRequest) { List<String> unknowns = new ArrayList<>(partialRequest.getUnknowns()); return sqlQueries(unknowns); } AstToSql(OpaCompilerResponse opaCompilerResponse); String getSqlQueryStatements(PartialRequest partialRequest); String getSqlQueryStatements(Set<String> opaPartialRequestUnknownProperty);  }
@Test void shouldGetSqlQueryStatementsFromPartialRequests() { String result = target.getSqlQueryStatements(partialRequest); assertThat(result, is("SELECT * FROM pets WHERE (pets.owner = 'alice' AND pets.name = 'fluffy') OR (pets.veterinarian = 'alice' AND pets.clinic = 'SOMA' AND pets.name = 'fluffy');")); }
@Test void shouldGetSqlQueryStatementsFromUnknowns() { String result = target.getSqlQueryStatements(Set.of("data.pets")); assertThat(result, is("SELECT * FROM pets WHERE (pets.owner = 'alice' AND pets.name = 'fluffy') OR (pets.veterinarian = 'alice' AND pets.clinic = 'SOMA' AND pets.name = 'fluffy');")); }