Пример #1
0
 /** when string contains '*' */
 @Test
 public void testApplyImplicitAsteriskSearchText_Case2() {
   DataSearchQueryBuilder uut = new DataSearchQueryBuilder(dsf, userInfoMock);
   String searchText =
       "one*"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "two"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "three";
   final String applyImplicitAsteriskSearchText = uut.applyImplicitAsteriskSearchText(searchText);
   assertEquals(
       "Verify that implicit asterisk NOT applied", searchText, applyImplicitAsteriskSearchText);
 }
Пример #2
0
 /** when asterisks needed */
 @Test
 public void testApplyImplicitAsteriskSearchText_Case1() {
   DataSearchQueryBuilder uut = new DataSearchQueryBuilder(dsf, userInfoMock);
   String searchText =
       "one"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "two"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "three";
   final String applyImplicitAsteriskSearchText = uut.applyImplicitAsteriskSearchText(searchText);
   final String expected =
       "*one*"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "*two*"
           + DataSearchQueryBuilder.OR_OPERATOR
           + "*three*";
   assertEquals(
       "Verify application of implicit asterisk(*)", expected, applyImplicitAsteriskSearchText);
 }