File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/communication Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 2020
2121import static org .assertj .core .api .Assertions .assertThat ;
2222
23- class DocumentQueryConversorTest {
23+ class DocumentQueryConverterTest {
2424
2525 @ ParameterizedTest
2626 @ CsvSource (textBlock = """
27- Max_;^Max.{1}
28- Max%;^Max.{1,}
29- M_x;^M.{1}x
30- M%x;^M.{1,}x
31- _ax;^.{1}ax
32- %ax;^.{1,}ax
27+ Max_;^\\ QM \\ E \\ Qa \\ E \\ Qx \\ E.$
28+ Max%;^\\ QM \\ E \\ Qa \\ E \\ Qx \\ E.*$
29+ M_x;^\\ QM \\ E. \\ Qx \\ E$
30+ M%x;^\\ QM \\ E.* \\ Qx \\ E$
31+ _ax;^.\\ Qa \\ E \\ Qx \\ E$
32+ %ax;^.* \\ Qa \\ E \\ Qx \\ E$
3333 ;^$
3434 """ , delimiterString = ";" )
3535 void shouldPrepareRegexValueSupportedByMongoDB (String rawValue , String expectedValue ) {
3636 assertThat (DocumentQueryConversor .prepareRegexValue (rawValue ))
3737 .as ("The value should be prepared to be used in a MongoDB regex query: " +
38- "the '_' character should matches any single character, and " +
39- "the '%' character should matches any sequence of characters." )
38+ "the '_' character should match any single character, and " +
39+ "the '%' character should match any sequence of characters." )
4040 .isEqualTo (expectedValue );
4141 }
4242
4343 @ Test
44- void shouldReturnEmptyRegexWhenRawValueIsNull () {
44+ void shouldReturnNeverMatchingRegexWhenRawValueIsNull () {
4545 assertThat (DocumentQueryConversor .prepareRegexValue (null ))
46- .as ("should return an empty regex when the raw value is null" )
47- .isEqualTo ("^$ " );
46+ .as ("should return a never-matching regex when the raw value is null" )
47+ .isEqualTo ("(?!) " );
4848 }
4949}
You can’t perform that action at this time.
0 commit comments