From bb4040b9704f3b1863e73a6d9f185c577cf61808 Mon Sep 17 00:00:00 2001 From: Lukasz Antoniak Date: Wed, 19 Jun 2024 18:45:57 +0200 Subject: [PATCH] Fix unit tests --- proxy/pkg/zdmproxy/cqlparser_search_test.go | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/proxy/pkg/zdmproxy/cqlparser_search_test.go b/proxy/pkg/zdmproxy/cqlparser_search_test.go index c293a4b..951bcd7 100644 --- a/proxy/pkg/zdmproxy/cqlparser_search_test.go +++ b/proxy/pkg/zdmproxy/cqlparser_search_test.go @@ -17,51 +17,51 @@ func TestParseAndInspect_SearchRequests(t *testing.T) { tests := []testParams{ {"Query using CONTAINS", "select * from person where hometown contains 'Bangkok';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using greater and less than", "select * from person where age > 35 and age < 80;", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using basic solr_query clause", "select * from person where solr_query='firstname: Olga firstname: Raymond -hometown: Bangkok';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using JSON solr_query clause", "select * from person where solr_query='{\"q\":\"hometown:Bangkok\"}';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using JSON solr_query clause with faceting", "select * from person where solr_query='{\"q\":\"id:*\",\"facet\":{\"field\":\"hometown\"}}';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using JSON solr_query clause for generic single pass search", "select * from person where solr_query='{\"q\" : \"*:*\", \"distrib.singlePass\" : true}';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using SAI fuzzy search operator", "select * from person where nick_name:'fuzzy';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using OR operator in SAI index", "select * from person where nick_name = 'Foo' or nick_name = 'Bar' and age > 10;", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using CONTAINS KEY operator in SAI index", "SELECT * FROM cyclist_teams WHERE teams CONTAINS KEY 2014;", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using CONTAINS operator and UDT", "SELECT * FROM cycling.cyclist_races WHERE races CONTAINS { race_title:'Rabobank 7-Dorpenomloop Aalburg', race_date:'2015-05-09', race_time:'02:58:33' };", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query using CONTAINS KEY operator in SAI index", "SELECT * FROM cyclist_teams WHERE teams CONTAINS 'Team Garmin - Cervelo';", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, {"Query IN operator", "SELECT * FROM cycling.comments_vs WHERE created_at IN ('2017-03-21 21:11:09.999000+0000', '2017-03-22 01:16:59.001000+0000');", - NewGenericRequestInfo(forwardToOrigin, true, true), + NewGenericRequestInfo(forwardToOrigin, true, true, primitive.OpCodeQuery), }, }