}
@Test
@Transactional
public void testSaveGroup() {
Group entity = new Group();
entity.setName("test");
entity.setRemark("...");
entity.setType(GroupType.RoleGorup.getValue());
entity.setState(State.Enable.getValue());
int before = countRowsInTable("tb_group");
accountManager.saveGroup(entity);
int after = countRowsInTable("tb_group");
assertEquals(before + 1, after);
assertFalse(entity.getLeaf());
Group parent = accountManager.getGroup("SJDK3849CKMS3849DJCK2039ZMSK0002");
entity.setParent(parent);
accountManager.saveGroup(entity);
assertTrue(parent.getLeaf());
entity.setParent(null);
accountManager.saveGroup(entity);
assertFalse(entity.getLeaf());
}