Пример #1
0
  @SuppressWarnings("unchecked")
  @Test
  @DataSet
  public void testMassUpdate() {
    List<Integer> updateKeys = Arrays.asList(1, 2, 3);
    Account account = new Account();
    account.setAssignuser("hai79");
    account.setIndustry("aaa");
    accountService.massUpdateWithSession(account, updateKeys, 1);

    AccountSearchCriteria criteria = new AccountSearchCriteria();
    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", "assignuser")
        .contains(
            tuple(1, "xyz", "aaa", "hai79"),
            tuple(2, "xyz1", "aaa", "hai79"),
            tuple(3, "xyz2", "aaa", "hai79"));
  }
Пример #2
0
  @Test
  @DataSet
  public void testMassUpdate() {
    List<Integer> updateKeys = Arrays.asList(1, 2, 3);
    Account account = new Account();
    account.setAssignuser("hai79");
    account.setIndustry("aaa");
    accountService.massUpdateWithSession(account, updateKeys, 1);

    AccountSearchCriteria criteria = new AccountSearchCriteria();
    criteria.setSaccountid(new NumberSearchField(1));

    List<SimpleAccount> accountList =
        accountService.findPagableListByCriteria(
            new SearchRequest<AccountSearchCriteria>(criteria, 0, Integer.MAX_VALUE));
    Assert.assertEquals(3, accountList.size());
    for (SimpleAccount account1 : accountList) {
      Assert.assertEquals("hai79", account1.getAssignuser());
    }
  }