@DataSet @Test public void testSearchAnyPhoneField() { AccountSearchCriteria criteria = new AccountSearchCriteria(); criteria.setAnyPhone(new StringSearchField(SearchField.AND, "111")); criteria.setSaccountid(new NumberSearchField(1)); Assert.assertEquals(2, accountService.getTotalCount(criteria)); }
@SuppressWarnings("unchecked") @DataSet @Test public void testSearchAnyPhoneField() { AccountSearchCriteria criteria = new AccountSearchCriteria(); criteria.setAnyPhone(new StringSearchField(SearchField.AND, "111")); criteria.setSaccountid(new NumberSearchField(1)); List<SimpleAccount> accounts = accountService.findPagableListByCriteria( new SearchRequest<>(criteria, 0, Integer.MAX_VALUE)); assertThat(accounts.size()).isEqualTo(2); assertThat(accounts) .extracting("id", "accountname", "industry") .contains(tuple(1, "xyz", "a"), tuple(2, "xyz1", "b")); }