File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed
jnosql-oracle-nosql/src/test/java/org/eclipse/jnosql/databases/oracle/communication Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 1414 */
1515package org .eclipse .jnosql .databases .oracle .communication ;
1616
17- import static org .junit .jupiter .api .Assertions .*;
17+ import org .junit .jupiter .api .DisplayName ;
18+ import org .junit .jupiter .api .Test ;
19+ import org .junit .jupiter .params .ParameterizedTest ;
20+ import org .junit .jupiter .params .provider .CsvSource ;
21+
22+ import static org .assertj .core .api .Assertions .assertThat ;
1823
1924class OracleNoSqlLikeConverterTest {
2025
26+ @ ParameterizedTest (name = "LIKE \" {0}\" -> pattern \" {1}\" " )
27+ @ CsvSource (textBlock = """
28+ %Ota%;.*\\ QOta\\ E.*
29+ Ota%;\\ QOta\\ E.*
30+ %Ota;.*\\ QOta\\ E
31+ Ota;\\ QOta\\ E
32+ Ot_;\\ QOt\\ E.
33+ _ta;.\\ Qta\\ E
34+ %t_a%;.*\\ Qt\\ E.\\ Qa\\ E.*
35+ .+;\\ Q.+\\ E
36+ """ , delimiter = ';' )
37+ @ DisplayName ("Converts SQL LIKE to Oracle NoSQL regex_like pattern (%, _ and literal quoting)" )
38+ void shouldConvertSqlLikeToOracleNoSqlRegex (String like , String expected ) {
39+ String actual = OracleNoSqlLikeConverter .convert (like );
40+ assertThat (actual ).isEqualTo (expected );
41+ }
42+
43+ @ Test
44+ @ DisplayName ("Returns empty string for null input" )
45+ void shouldReturnEmptyForNull () {
46+ assertThat (OracleNoSqlLikeConverter .convert (null )).isEqualTo ("" );
47+ }
48+
49+ @ Test
50+ @ DisplayName ("Returns empty string for empty input" )
51+ void shouldReturnEmptyForEmptyString () {
52+ assertThat (OracleNoSqlLikeConverter .convert ("" )).isEqualTo ("" );
53+ }
2154}
You can’t perform that action at this time.
0 commit comments