@Before
public void init() throws Exception {
userManager.setName("john");
securityDAO.createAuthority("registered_user");
UserImpl john = new UserImpl();
john.setUsername("john");
john.setPassword("john");
john.setName("John Smith");
john.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
securityDAO.createUser(john);
assertNotNull(securityDAO.findUser("john"));
UserImpl mary = new UserImpl();
mary.setUsername("mary");
mary.setPassword("mary");
mary.setName("Mary Poppins");
mary.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
securityDAO.createUser(mary);
assertNotNull(securityDAO.findUser("mary"));
UserImpl viewer = new UserImpl();
viewer.setUsername("viewer");
viewer.setPassword("viewer");
viewer.setName("viewer");
viewer.addRole((RoleImpl) securityDAO.findAuthority("registered_user"));
securityDAO.createUser(viewer);
assertNotNull(securityDAO.findUser("viewer"));
OwnedEntity one = new OwnedEntity();
one.setName("one");
dao.create(one);