Browse Source

加单元测试

pull/38/head
zed 5 years ago
parent
commit
59913502d7
  1. 30
      src/test/java/com/fanruan/api/decision/AuthorityKitTest.java
  2. 24
      src/test/java/com/fanruan/api/decision/role/CustomRoleKitTest.java
  3. 25
      src/test/java/com/fanruan/api/decision/user/UserKitTest.java

30
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);
}
}

24
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);
}
}

25
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);
}
}
Loading…
Cancel
Save