@Test void testCreateQueryParseException() { String rsqlQuery = "illegalQuery"; assertThrows(QueryParseException.class, () -> queryConverter.convert(rsqlQuery)); }
@Override public Query convert(@Nonnull String source) { Node node; try { node = rsqlParser.parse(source); } catch (RSQLParserException e) { Throwable cause = e.getCause(); if (cause instanceof UnknownOperatorException) { String operator = ((UnknownOperatorException) cause).getOperator(); throw new UnknownQueryOperatorException(operator); } else { throw new QueryParseException(e); } } return node.accept(rsqlVisitor); }
QueryConverter implements Converter<String, Query> { @Override public Query convert(@Nonnull String source) { Node node; try { node = rsqlParser.parse(source); } catch (RSQLParserException e) { Throwable cause = e.getCause(); if (cause instanceof UnknownOperatorException) { String operator = ((UnknownOperatorException) cause).getOperator(); throw new UnknownQueryOperatorException(operator); } else { throw new QueryParseException(e); } } return node.accept(rsqlVisitor); } }
QueryConverter implements Converter<String, Query> { @Override public Query convert(@Nonnull String source) { Node node; try { node = rsqlParser.parse(source); } catch (RSQLParserException e) { Throwable cause = e.getCause(); if (cause instanceof UnknownOperatorException) { String operator = ((UnknownOperatorException) cause).getOperator(); throw new UnknownQueryOperatorException(operator); } else { throw new QueryParseException(e); } } return node.accept(rsqlVisitor); } QueryConverter(RSQLParser rsqlParser, QueryRsqlVisitor rsqlVisitor); }
QueryConverter implements Converter<String, Query> { @Override public Query convert(@Nonnull String source) { Node node; try { node = rsqlParser.parse(source); } catch (RSQLParserException e) { Throwable cause = e.getCause(); if (cause instanceof UnknownOperatorException) { String operator = ((UnknownOperatorException) cause).getOperator(); throw new UnknownQueryOperatorException(operator); } else { throw new QueryParseException(e); } } return node.accept(rsqlVisitor); } QueryConverter(RSQLParser rsqlParser, QueryRsqlVisitor rsqlVisitor); @Override Query convert(@Nonnull String source); }
QueryConverter implements Converter<String, Query> { @Override public Query convert(@Nonnull String source) { Node node; try { node = rsqlParser.parse(source); } catch (RSQLParserException e) { Throwable cause = e.getCause(); if (cause instanceof UnknownOperatorException) { String operator = ((UnknownOperatorException) cause).getOperator(); throw new UnknownQueryOperatorException(operator); } else { throw new QueryParseException(e); } } return node.accept(rsqlVisitor); } QueryConverter(RSQLParser rsqlParser, QueryRsqlVisitor rsqlVisitor); @Override Query convert(@Nonnull String source);  }