示例#1
0
  @Test
  @DataSet
  public void testSearchWebsite() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setWebsite(new StringSearchField(SearchField.AND, "http://www.esofthead.com"));
    criteria.setSaccountid(new NumberSearchField(1));

    Assert.assertEquals(3, accountService.getTotalCount(criteria));
    Assert.assertEquals(
        3,
        accountService
            .findPagableListByCriteria(
                new SearchRequest<AccountSearchCriteria>(criteria, 0, Integer.MAX_VALUE))
            .size());
  }
示例#2
0
  @SuppressWarnings("unchecked")
  @Test
  @DataSet
  public void testSearchWebsite() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setWebsite(new StringSearchField(SearchField.AND, "http://www.esofthead.com"));
    criteria.setSaccountid(new NumberSearchField(1));

    List<SimpleAccount> accounts =
        accountService.findPagableListByCriteria(
            new SearchRequest<>(criteria, 0, Integer.MAX_VALUE));

    assertThat(accounts.size()).isEqualTo(3);
    assertThat(accounts)
        .extracting("id", "accountname", "industry")
        .contains(tuple(1, "xyz", "a"), tuple(2, "xyz1", "b"), tuple(3, "xyz2", "c"));
  }