private SystemVariableManager systemVariableManager;
@Test
@Transactional
public void testSaveDictionaryCategory() {
DictionaryCategory category = new DictionaryCategory();
category.setCode("test");
category.setName("测试");
category.setRemark("*");
int beforeRow = countRowsInTable("TB_DICTIONARY_CATEGORY");
systemVariableManager.saveDictionaryCategory(category);
int afterRow = countRowsInTable("TB_DICTIONARY_CATEGORY");
assertEquals(afterRow, beforeRow + 1);
assertFalse(category.getLeaf());
DictionaryCategory parent = systemVariableManager.getDictionaryCategory("402881e437d47b250137d485274b0005");
category.setParent(parent);
systemVariableManager.saveDictionaryCategory(category);
assertTrue(parent.getLeaf());
category.setParent(null);
systemVariableManager.saveDictionaryCategory(category);
assertFalse(parent.getLeaf());
}