Ejemplo n.º 1
0
 @Test
 public void testFindAllAccounts() {
   List<Account> accs = service.findAllAccounts();
   assertEquals("Check DB is empty first", 1, accs.size()); // always the
   // batch
   // test
   // account
   // created -
   // needed
   // for
   // persistence
   Account a = new Account();
   a.setUserName("robb");
   a.setPassword("password");
   service.storeAccount(a);
   accs = service.findAllAccounts();
   assertEquals("check Account has been created", 2, accs.size());
 }
Ejemplo n.º 2
0
 @Test
 public void testLoadAccount() {
   List<Account> accs = service.findAllAccounts();
   assertTrue(accs.size() > 0);
   Account original = accs.get(0);
   Account a = service.loadAccount(original.getId()); // this is will load
   // the test account
   assertNotNull(a);
   assertEquals(original.getUserName(), a.getUserName());
 }