From 118d77cd7025dcbe3031bc41450ec285afff4b9f Mon Sep 17 00:00:00 2001 From: Yuriy M <95305560+yuremm@users.noreply.github.com> Date: Tue, 16 Aug 2022 12:18:08 +0300 Subject: [PATCH] feat: fix susrefire tests in filter module (#2141) * feat: use surefire plugin in filter module only * feat: change gluuScrTyp to jansScrTyp in tests Co-authored-by: Yuriy Movchan --- .../test/CouchbaseFilterConverterTest.java | 4 ++-- jans-orm/filter/pom.xml | 19 ++++++++++++------- jans-orm/pom.xml | 13 ------------- .../sql/impl/test/SqlFilterConverterTest.java | 2 +- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/jans-orm/couchbase/src/test/java/io/jans/orm/couchbase/impl/test/CouchbaseFilterConverterTest.java b/jans-orm/couchbase/src/test/java/io/jans/orm/couchbase/impl/test/CouchbaseFilterConverterTest.java index 89aa3d6aeaa..dea1a32b70a 100644 --- a/jans-orm/couchbase/src/test/java/io/jans/orm/couchbase/impl/test/CouchbaseFilterConverterTest.java +++ b/jans-orm/couchbase/src/test/java/io/jans/orm/couchbase/impl/test/CouchbaseFilterConverterTest.java @@ -526,8 +526,8 @@ public void checkOrWithLowerCaseFilter() throws SearchException { ConvertedExpression expression = simpleConverter.convertToCouchbaseFilter(filter, null, null); String query = toSelectSQL(expression); - assertEquals(expression.expression(), "( ( LOWER( description ) LIKE %$description_any% OR LOWER( displayName ) LIKE %$displayName_any% ) AND ( ( gluuScrTyp = $gluuScrTyp ) OR ( $gluuScrTyp IN gluuScrTyp ) ) )"); - assertEquals(query, "SELECT gluu_doc.* FROM `gluu` AS gluu_doc WHERE ( ( LOWER( description ) LIKE \"%test_value%\" OR LOWER( displayName ) LIKE \"%test_value%\" ) AND ( ( gluuScrTyp = \"person_authentication\" ) OR ( \"person_authentication\" IN gluuScrTyp ) ) )"); + assertEquals(expression.expression(), "( ( LOWER( description ) LIKE %$description_any% OR LOWER( displayName ) LIKE %$displayName_any% ) AND ( ( jansScrTyp = $jansScrTyp ) OR ( $jansScrTyp IN jansScrTyp ) ) )"); + assertEquals(query, "SELECT gluu_doc.* FROM `gluu` AS gluu_doc WHERE ( ( LOWER( description ) LIKE \"%test_value%\" OR LOWER( displayName ) LIKE \"%test_value%\" ) AND ( ( jansScrTyp = \"person_authentication\" ) OR ( \"person_authentication\" IN jansScrTyp ) ) )"); } private String toSelectSQL(ConvertedExpression convertedExpression) { diff --git a/jans-orm/filter/pom.xml b/jans-orm/filter/pom.xml index ccabd0f6587..6b924317d10 100644 --- a/jans-orm/filter/pom.xml +++ b/jans-orm/filter/pom.xml @@ -13,13 +13,18 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - false - - + + org.apache.maven.plugins + maven-surefire-plugin + + + false + false + + target/test-classes/testng.xml + + + diff --git a/jans-orm/pom.xml b/jans-orm/pom.xml index 8aeb0033ac6..ab847b1525f 100644 --- a/jans-orm/pom.xml +++ b/jans-orm/pom.xml @@ -128,19 +128,6 @@ jacoco-maven-plugin ${jacoco.version} - - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - @{argLine} - false - false - - target/test-classes/testng.xml - - - diff --git a/jans-orm/sql/src/test/java/io/jans/orm/sql/impl/test/SqlFilterConverterTest.java b/jans-orm/sql/src/test/java/io/jans/orm/sql/impl/test/SqlFilterConverterTest.java index a008f1da773..b4e4f21c1a5 100644 --- a/jans-orm/sql/src/test/java/io/jans/orm/sql/impl/test/SqlFilterConverterTest.java +++ b/jans-orm/sql/src/test/java/io/jans/orm/sql/impl/test/SqlFilterConverterTest.java @@ -454,7 +454,7 @@ public void checkOrWithLowerCaseFilter() throws SearchException { ConvertedExpression expression = simpleConverter.convertToSqlFilter(filter, null, null); String query = toSelectSQL(expression); - assertEquals(query, "select doc.`*` from `table` as doc where (lower(doc.description) like '%test_value%' or lower(doc.displayName) like '%test_value%') and doc.gluuScrTyp = 'person_authentication'"); + assertEquals(query, "select doc.`*` from `table` as doc where (lower(doc.description) like '%test_value%' or lower(doc.displayName) like '%test_value%') and doc.jansScrTyp = 'person_authentication'"); } private String toSelectSQL(ConvertedExpression convertedExpression) {