assertEquals("Developer", pRole.getLabel());
}
@Test
public void testPersonWithRoles() {
Person p = new Person();
p.setFirstName("Emanuel");
p.setLastName("Giger");
p.addNickName("Gigs");
p.addNickName("Flex0r");
Role firstRole = new Role("Developer");
Role secondRole = new Role("Gamer");
p.addRole(firstRole);
p.addRole(secondRole);
save(p, firstRole, secondRole);
Person loadedP = loadUnique("from Person", Person.class);
assertEquals("Emanuel Giger", loadedP.getLabel());
Set<Role> roles = loadedP.getRoles();
assertEquals(2, roles.size());
assertTrue(roles.contains(firstRole));
assertTrue(roles.contains(secondRole));
}