Example #1
0
  @Test
  @DataSet
  public void tesSearchAnyAddress() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setAnyAddress(new StringSearchField(SearchField.AND, "123"));
    criteria.setSaccountid(new NumberSearchField(1));

    Assert.assertEquals(2, accountService.getTotalCount(criteria));
    Assert.assertEquals(
        2,
        accountService
            .findPagableListByCriteria(
                new SearchRequest<AccountSearchCriteria>(criteria, 0, Integer.MAX_VALUE))
            .size());
  }
  @SuppressWarnings("unchecked")
  @Test
  @DataSet
  public void tesSearchAnyAddress() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setAnyAddress(new StringSearchField(SearchField.AND, "123"));
    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"));
  }