parent
c09249dfe4
commit
bbc8f2fc9c
@ -0,0 +1,35 @@ |
||||
package edu.ncst.award; |
||||
|
||||
import edu.ncst.award.model.system.Role; |
||||
import edu.ncst.award.service.impl.system.ResourceServiceImpl; |
||||
import edu.ncst.award.service.impl.system.SystemService; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
import java.util.ArrayList; |
||||
|
||||
@SpringBootTest |
||||
public class TestResourceService { |
||||
|
||||
@Autowired |
||||
ResourceServiceImpl resourceService; |
||||
|
||||
@Test |
||||
public void getResourceByRoleNames(){ |
||||
ArrayList<String> roleNames = new ArrayList(); |
||||
roleNames.add("NORMAL"); |
||||
resourceService.getUserScopeResourceList(roleNames); |
||||
System.out.println(); |
||||
} |
||||
@Test |
||||
public void interfaceMetaData(){ |
||||
resourceService.getSystemInterfaceMetas(); |
||||
} |
||||
@Test |
||||
public void reimportInterfaceMeta(){ |
||||
resourceService.reimportInterfaceMeta(); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,21 @@ |
||||
package edu.ncst.award; |
||||
|
||||
import edu.ncst.award.service.impl.system.SysRoleServiceImpl; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
@SpringBootTest |
||||
public class TestRoleService { |
||||
|
||||
@Resource |
||||
SysRoleServiceImpl sysRoleService; |
||||
|
||||
@Test |
||||
public void selectRoleList(){ |
||||
sysRoleService.selectRoleAll(); |
||||
System.out.println(); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,54 @@ |
||||
package edu.ncst.award; |
||||
|
||||
import cn.hutool.json.JSONUtil; |
||||
import edu.ncst.award.common.util.treeUtils.TreeNode; |
||||
import edu.ncst.award.common.util.treeUtils.TreeNodeConfig; |
||||
import edu.ncst.award.common.util.treeUtils.TreeNodeMap; |
||||
import edu.ncst.award.common.util.treeUtils.TreeUtils; |
||||
import edu.ncst.award.model.system.Menu; |
||||
import edu.ncst.award.service.impl.system.MenuServiceImpl; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
import org.springframework.security.core.context.SecurityContextHolder; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
@SpringBootTest |
||||
public class TestSystemMenuService { |
||||
int i = 1; |
||||
|
||||
@Autowired |
||||
MenuServiceImpl menuService; |
||||
|
||||
|
||||
@Test |
||||
public void getCurrentUser(){ |
||||
SecurityContextHolder.getContext().getAuthentication().getDetails(); |
||||
} |
||||
|
||||
|
||||
@Test |
||||
public void buildMenus() { |
||||
menuService.buildMenus(menuService.getAllMenusById(0)); |
||||
} |
||||
|
||||
@Test |
||||
public void buildByList() { |
||||
List<Menu> menus = menuService.getAllMenusById(0); |
||||
TreeNodeConfig treeNodeConfig = new TreeNodeConfig(); |
||||
treeNodeConfig.setIdKey("nihao"); |
||||
// List<TreeNodeMap> treeNodes = TreeUtils.build(0, menus, (menu, treeNode) -> {
|
||||
// treeNode.setId(menu.getId());
|
||||
// treeNode.setParentId(menu.getParentId());
|
||||
// treeNode.setName(menu.getName());
|
||||
// treeNode.extra("nihao","woshi yly");
|
||||
// });
|
||||
// System.out.println(JSONUtil.formatJsonStr(JSONUtil.toJsonStr(treeNodes)));
|
||||
System.out.println("你哦安徽"); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,29 @@ |
||||
package edu.ncst.award; |
||||
|
||||
import edu.ncst.award.service.impl.system.ResourceServiceImpl; |
||||
import edu.ncst.award.service.impl.system.UserServiceImpl; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.junit.jupiter.api.Test; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
||||
@SpringBootTest |
||||
public class TestUserService { |
||||
@Autowired |
||||
private UserServiceImpl userService; |
||||
@Autowired |
||||
private ResourceServiceImpl resourceService; |
||||
|
||||
@Test |
||||
public void batchDeleteByIds(){ |
||||
userService.deleteUserByIds(new Long[]{24L}); |
||||
} |
||||
|
||||
|
||||
|
||||
@Test |
||||
public void getCurrentUserInfo(){ |
||||
userService.getCurrentUser(); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue