AstToSql { String andOperationConstraints(List<Predicate> predicates) { List<SqlPredicate> sqlPredicates = predicates.stream() .map(predicate -> new PredicateConverter(predicate).astToSqlPredicate()). collect(toList()); return SqlUtil.concatByAndOperation(sqlPredicates); } AstToSql(OpaCompilerResponse opaCompilerResponse); String getSqlQueryStatements(PartialRequest partialRequest); String getSqlQueryStatements(Set<String> opaPartialRequestUnknownProperty);  }
@Test void shouldGetConstraintsFromPredicates() { List<Predicate> predicates = opaCompilerResponse.getResult().getQueries().get(0); String result = target.andOperationConstraints(predicates); assertThat(result, is("(pets.owner = 'alice' AND pets.name = 'fluffy')")); }