From 59913502d739aa971091c6d8dc60f5fb9282f35f Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 30 Apr 2020 14:55:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/decision/AuthorityKitTest.java | 30 +++++++++++++++++++ .../api/decision/role/CustomRoleKitTest.java | 24 +++++++++++++++ .../api/decision/user/UserKitTest.java | 25 ++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 src/test/java/com/fanruan/api/decision/AuthorityKitTest.java create mode 100644 src/test/java/com/fanruan/api/decision/role/CustomRoleKitTest.java create mode 100644 src/test/java/com/fanruan/api/decision/user/UserKitTest.java diff --git a/src/test/java/com/fanruan/api/decision/AuthorityKitTest.java b/src/test/java/com/fanruan/api/decision/AuthorityKitTest.java new file mode 100644 index 0000000..ebf3366 --- /dev/null +++ b/src/test/java/com/fanruan/api/decision/AuthorityKitTest.java @@ -0,0 +1,30 @@ +package com.fanruan.api.decision; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Method; + +/** + * @author Zed + * @version 10.0 + * Created by Zed on 2020/4/30 + */ +public class AuthorityKitTest { + + @Test + public void setAuth() throws Exception { + + Class classBook = Class.forName("com.fanruan.api.decision.AuthorityKit"); + Assert.assertNotNull(classBook); + + Method method1 = classBook.getDeclaredMethod("setCustomRoleAuth", String.class, int.class, String.class, int.class); + Assert.assertNotNull(method1); + + Method method2 = classBook.getDeclaredMethod("setUserAuth", String.class, int.class, String.class, int.class); + Assert.assertNotNull(method2); + + Method method3 = classBook.getDeclaredMethod("setDepAuth", String.class, int.class, String.class, int.class); + Assert.assertNotNull(method3); + } +} diff --git a/src/test/java/com/fanruan/api/decision/role/CustomRoleKitTest.java b/src/test/java/com/fanruan/api/decision/role/CustomRoleKitTest.java new file mode 100644 index 0000000..e3b1289 --- /dev/null +++ b/src/test/java/com/fanruan/api/decision/role/CustomRoleKitTest.java @@ -0,0 +1,24 @@ +package com.fanruan.api.decision.role; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Method; + +/** + * @author Zed + * @version 10.0 + * Created by Zed on 2020/4/30 + */ +public class CustomRoleKitTest { + + @Test + public void getCustomRoleIds() throws Exception { + + Class classBook = Class.forName("com.fanruan.api.decision.role.CustomRoleKit"); + Assert.assertNotNull(classBook); + + Method method1 = classBook.getDeclaredMethod("getCustomRoleIds", String.class, String.class); + Assert.assertNotNull(method1); + } +} diff --git a/src/test/java/com/fanruan/api/decision/user/UserKitTest.java b/src/test/java/com/fanruan/api/decision/user/UserKitTest.java new file mode 100644 index 0000000..92c2f08 --- /dev/null +++ b/src/test/java/com/fanruan/api/decision/user/UserKitTest.java @@ -0,0 +1,25 @@ +package com.fanruan.api.decision.user; + +import org.junit.Assert; +import org.junit.Test; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; + +/** + * @author Zed + * @version 10.0 + * Created by Zed on 2020/4/30 + */ +public class UserKitTest { + + @Test + public void getCurrentUserId() throws Exception { + + Class classBook = Class.forName("com.fanruan.api.decision.user.UserKit"); + Assert.assertNotNull(classBook); + + Method method1 = classBook.getDeclaredMethod("getCurrentUserId", HttpServletRequest.class); + Assert.assertNotNull(method1); + } +}