예제 #1
0
  @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));
  }
예제 #2
0
  @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"));
  }