Skip to content

Commit

Permalink
feat: fix susrefire tests in filter module (#2141)
Browse files Browse the repository at this point in the history
* feat: use surefire plugin in filter module only

* feat: change gluuScrTyp to jansScrTyp in tests

Co-authored-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
  • Loading branch information
yuremm and yurem committed Aug 16, 2022
1 parent 119ecfa commit 118d77c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
19 changes: 12 additions & 7 deletions jans-orm/filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>false</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- <argLine>@{argLine}</argLine> -->
<failIfNoTests>false</failIfNoTests>
<trimStackTrace>false</trimStackTrace>
<suiteXmlFiles>
<suiteXmlFile>target/test-classes/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
13 changes: 0 additions & 13 deletions jans-orm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,6 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<argLine>@{argLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<trimStackTrace>false</trimStackTrace>
<suiteXmlFiles>
<suiteXmlFile>target/test-classes/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 118d77c

Please sign in to comment.