NIFI-10875 Changed TestQuerySolr to check for path elements

- Changes avoid non-deterministic expectations for query parameters

This closes #6718

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Yihen Liu 2022-11-24 13:37:29 -06:00 committed by exceptionfactory
parent 43a8b858ca
commit a3c895341c
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 18 additions and 6 deletions

View File

@ -602,8 +602,12 @@ public class TestQuerySolr {
assertEquals(SOLR_CONNECT, attributes.get(QuerySolr.ATTRIBUTE_SOLR_CONNECT));
assertEquals(DEFAULT_SOLR_CORE, attributes.get(QuerySolr.ATTRIBUTE_SOLR_COLLECTION));
assertEquals("q=*:*&qt=/select&start=0&rows=10&stats=true&facet=true", attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("q=*:*"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("qt=/select"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("start=0"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("rows=10"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("stats=true"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("facet=true"));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_STATUS));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_START));
assertEquals("10", attributes.get(QuerySolr.ATTRIBUTE_SOLR_ROWS));
@ -626,8 +630,12 @@ public class TestQuerySolr {
assertEquals(SOLR_CONNECT, attributes.get(QuerySolr.ATTRIBUTE_SOLR_CONNECT));
assertEquals(DEFAULT_SOLR_CORE, attributes.get(QuerySolr.ATTRIBUTE_SOLR_COLLECTION));
assertEquals("q=*:*&qt=/select&start=0&rows=10&stats=true&facet=true", attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("q=*:*"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("qt=/select"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("start=0"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("rows=10"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("stats=true"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("facet=true"));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_STATUS));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_START));
assertEquals("10", attributes.get(QuerySolr.ATTRIBUTE_SOLR_ROWS));
@ -650,8 +658,12 @@ public class TestQuerySolr {
assertEquals(SOLR_CONNECT, attributes.get(QuerySolr.ATTRIBUTE_SOLR_CONNECT));
assertEquals(DEFAULT_SOLR_CORE, attributes.get(QuerySolr.ATTRIBUTE_SOLR_COLLECTION));
assertEquals("q=*:*&qt=/select&start=0&rows=10&stats=true&facet=true", attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("q=*:*"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("qt=/select"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("start=0"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("rows=10"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("stats=true"));
assertTrue(attributes.get(QuerySolr.ATTRIBUTE_SOLR_QUERY).contains("facet=true"));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_STATUS));
assertEquals("0", attributes.get(QuerySolr.ATTRIBUTE_SOLR_START));
assertEquals("10", attributes.get(QuerySolr.ATTRIBUTE_SOLR_ROWS));