public void shouldParseFullTextSearchExpressionFromStringWithValidExpression() {
Position pos = new Position(500, 100, 13);
FullTextSearch.Term result = parser.parseFullTextSearchExpression("term1 term2 OR -term3 OR -term4 OR term5", pos);
assertThat(result, is(notNullValue()));
assertThat(result, is(instanceOf(Disjunction.class)));
Disjunction disjunction = (Disjunction)result;
assertThat(disjunction.getTerms().size(), is(4));
Conjunction conjunction1 = (Conjunction)disjunction.getTerms().get(0);
Term term3 = disjunction.getTerms().get(1);
Term term4 = disjunction.getTerms().get(2);
Term term5 = disjunction.getTerms().get(3);
FullTextSearchParserTest.assertHasSimpleTerms(conjunction1, "term1", "term2");
FullTextSearchParserTest.assertSimpleTerm(term3, "term3", true, false);
FullTextSearchParserTest.assertSimpleTerm(term4, "term4", true, false);
FullTextSearchParserTest.assertSimpleTerm(term5, "term5", false, false);
}