@Test
public void basicTest() {

    RedisRealm realm = getRealm();
    Account account = null;
    // Phineas
    account = realm.authenticate("phineas", "fail");
    assertNull(account);
    account = realm.authenticate("phineas", "iKnowWhatWereGonnaDoToday");
    assertNotNull(account);
    assertEquals("phineas", account.getUsername());
    assertEquals("Phineas Flynn", account.getName());
    assertTrue(account.getEmailAddresses().contains("phineas.flynn@disney.com"));
    assertTrue(account.hasRole("inventor"));
    assertTrue(account.isPermitted("secure:view"));
    // Ferb
    account = realm.authenticate("ferb", "fail");
    assertNull(account);
    account = realm.authenticate("ferb", "ferb");
    assertNotNull(account);
    assertEquals("ferb", account.getUsername());
    assertEquals("Ferb Fletcher", account.getName());
    assertTrue(account.getEmailAddresses().contains("ferb.fletcher@disney.com"));
    assertTrue(account.hasRole("inventor"));
    assertTrue(account.isPermitted("secure:view"));
    // Candace
    account = realm.authenticate("candace", "fail");
    assertNull(account);
    account = realm.authenticate("candace", "ilovejeremy");
    assertNotNull(account);
    assertEquals("candace", account.getUsername());
    assertEquals("Candace Flynn", account.getName());
    assertTrue(account.getEmailAddresses().contains("candace.flynn@disney.com"));
    assertFalse(account.hasRole("inventor"));
    assertTrue(account.isPermitted("secure:view"));
    // Linda
    account = realm.authenticate("linda", "fail");
    assertNull(account);
    account = realm.authenticate("linda", "imLindanaAndIWannaHaveFun");
    assertNotNull(account);
    assertEquals("linda", account.getUsername());
    assertEquals("Linda Flynn-Fletcher", account.getName());
    assertTrue(account.getEmailAddresses().contains("linda.fletcher@disney.com"));
    assertFalse(account.hasRole("inventor"));
    assertFalse(account.isPermitted("secure:view"));
    // Doofenshmirtz
    account = realm.authenticate("heinz", "CurseYouPerryThePlatypus");
    assertNull(account);
}