### Question:
SoapSecurityService extends AbstractService implements SecurityService { @Override public long storeGroup(String sid, WSGroup group) throws Exception { checkAdministrator(sid); try { GroupDAO dao = (GroupDAO) Context.get().getBean(GroupDAO.class); Group grp = group.toGroup(); if (group.getId() != 0) { grp = dao.findById(group.getId()); if (grp.getType() != Group.TYPE_DEFAULT) { throw new Exception(String.format("You cannot edit group with id %s because it is a system group", grp.getId())); } grp.setName(group.getName()); grp.setDescription(group.getDescription()); grp.setType(group.getType()); } if (StringUtils.isEmpty(grp.getName())) throw new Exception("Missing mandatory value 'Name'"); if (group.getUserIds() != null && group.getUserIds().length > 0) { UserDAO userDao = (UserDAO) Context.get().getBean(UserDAO.class); dao.initialize(grp); for (User usr : grp.getUsers()) { usr.removeGroup(grp.getId()); userDao.store(usr); } for (long userId : group.getUserIds()) { User user = userDao.findById(userId); grp.getUsers().add(user); user.addGroup(grp); userDao.store(user); } } if (dao.store(grp)) { if (group.getInheritGroupId() != null && group.getInheritGroupId().longValue() > 0) dao.inheritACLs(grp, group.getInheritGroupId().longValue()); return grp.getId(); } else throw new Exception("Unable to store the group"); } catch (Throwable t) { log.error(t.getMessage(), t); throw new Exception(t.getMessage()); } }  @Override WSUser[] listUsers(String sid, String group); @Override WSGroup[] listGroups(String sid); @Override long storeUser(String sid, WSUser user); @Override long storeGroup(String sid, WSGroup group); @Override void deleteUser(String sid, long userId); @Override void deleteGroup(String sid, long groupId); @Override int changePassword(String sid, long userId, String oldPassword, String newPassword); @Override WSUser getUser(String sid, long userId); @Override WSUser getUserByUsername(String sid, String username); @Override WSGroup getGroup(String sid, long groupId);  }### Answer:
@Test public void testStoreGroup() throws Exception { WSGroup wsGroupTest = new WSGroup(); wsGroupTest.setName("group test"); wsGroupTest.setDescription("group test descr"); Long groupId = securityServiceImpl.storeGroup("", wsGroupTest); Assert.assertNotNull(groupId); Group createdGroup = groupDao.findById(groupId); Assert.assertNotNull(createdGroup); Assert.assertEquals("group test", createdGroup.getName()); Assert.assertEquals("group test descr", createdGroup.getDescription()); }