mirror of https://github.com/apache/lucene.git
SOLR-13676: Reduce log verbosity in TestDistributedGrouping (#819)
* SOLR-13676: Reduce log verbosity in TestDistributedGrouping using ignoreException * Code review * Remove Assert
This commit is contained in:
parent
09993c6cf0
commit
751e64651c
|
@ -31,6 +31,8 @@ import org.apache.solr.common.util.NamedList;
|
||||||
import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
|
import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.hamcrest.CoreMatchers.containsString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO? perhaps use:
|
* TODO? perhaps use:
|
||||||
* http://docs.codehaus.org/display/JETTY/ServletTester
|
* http://docs.codehaus.org/display/JETTY/ServletTester
|
||||||
|
@ -221,12 +223,14 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
|
||||||
"fl", "id", "group.format", "grouped", "group.limit", "-12",
|
"fl", "id", "group.format", "grouped", "group.limit", "-12",
|
||||||
"sort", i1 + " asc, id asc");
|
"sort", i1 + " asc, id asc");
|
||||||
|
|
||||||
|
ignoreException("'group.offset' parameter cannot be negative");
|
||||||
SolrException exception = expectThrows(SolrException.class, () -> query("q", "*:*",
|
SolrException exception = expectThrows(SolrException.class, () -> query("q", "*:*",
|
||||||
"group", "true",
|
"group", "true",
|
||||||
"group.query", t1 + ":kings OR " + t1 + ":eggs", "group.offset", "-1")
|
"group.query", t1 + ":kings OR " + t1 + ":eggs", "group.offset", "-1")
|
||||||
);
|
);
|
||||||
assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, exception.code());
|
assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, exception.code());
|
||||||
assertTrue(exception.getMessage().contains("'group.offset' parameter cannot be negative"));
|
assertThat(exception.getMessage(), containsString("'group.offset' parameter cannot be negative"));
|
||||||
|
resetExceptionIgnores();
|
||||||
|
|
||||||
query("q", "*:*",
|
query("q", "*:*",
|
||||||
"group", "true",
|
"group", "true",
|
||||||
|
|
Loading…
Reference in New Issue