Exemplo n.º 1
0
  @SuppressWarnings("unchecked")
  @Test
  @DataSet
  public void testSearchByAssignUserName() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setAssignUser(new StringSearchField("hai79"));
    criteria.setSaccountid(new NumberSearchField(1));

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

    assertThat(accounts.size()).isEqualTo(1);
    assertThat(accounts).extracting("id", "accountname", "industry").contains(tuple(1, "xyz", "a"));
  }
Exemplo n.º 2
0
  @Test
  @DataSet
  public void testAssignUser() {
    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setAssignUser(new StringSearchField(SearchField.AND, "hai79"));
    criteria.setSaccountid(new NumberSearchField(1));

    Assert.assertEquals(1, accountService.getTotalCount(criteria));
    Assert.assertEquals(
        1,
        accountService
            .findPagableListByCriteria(
                new SearchRequest<AccountSearchCriteria>(criteria, 0, Integer.MAX_VALUE))
            .size());
  }