예제 #1
0
 @Test
 public void testFillMock() {
   AccountBean accountBean = new AccountBean();
   accountBean.fillMock();
   assertNotNull(accountBean.getFirstName());
   assertNotNull(accountBean.getLastName());
   assertNotNull(accountBean.getEmail());
   assertNotNull(accountBean.getPassword());
   assertEquals(accountBean.getPassword(), accountBean.getPasswordConfirm());
 }
예제 #2
0
  @Test
  public void testCreateAccount() {
    new DummyFacesContext().setFacesContextInstance();
    AccountBean accountBean = new AccountBean();

    assertNull(accountBean.createAccount());

    new DummyFacesContext().setFacesContextInstance();
    accountBean = new AccountBean();
    accountBean.fillMock();
    accountBean.setPasswordConfirm(accountBean.getPassword() + "a");

    assertNull(accountBean.createAccount());
  }