src/test/java/studio/baxia/fo/service/IUserServiceTest.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package studio.baxia.fo.service;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import studio.baxia.fo.BaseTest;
import studio.baxia.fo.pojo.Authors;
import studio.baxia.fo.util.MDUtil;

import java.security.NoSuchAlgorithmException;

/**
 * Created by FirePan on 2016/10/11.
 */
public class IUserServiceTest extends BaseTest {
    @Autowired
    private IUserService userService;

    // 获取当前方法名
    // new Throwable().getStackTrace()[0].getMethodName();

    @Test
    @Rollback(value = false)
    public void testAddAuthors() throws NoSuchAlgorithmException {
        String userName = "test";
        String userPass = "test123";
        String pass = MDUtil.generatePass(userName, userPass);
        int userStatus = 1;
        Authors authors = new Authors(userName,pass,userStatus);
        Integer result = userService.authorsAdd(authors);
        methodName=new Throwable().getStackTrace()[0].getMethodName();
        printResultStr(methodName, null,result);
    }
    @Test
    public void testEditAuthorsStatus(){
        Boolean result = userService.authorsEditStatus(1, 0);
        methodName=new Throwable().getStackTrace()[0].getMethodName();
        printResultStr(methodName, null,result);
    }

    @Test
    public void testGetAuthorsById() throws Exception {
        Authors result = userService.authorsGetById(1);
        methodName=new Throwable().getStackTrace()[0].getMethodName();
        printResultStr(methodName, null,result);
    }

    @Test
    public void testGetAuthorsByAccount() throws Exception {
        Authors result = userService.authorsGetByAccount("panhainan");
        methodName=new Throwable().getStackTrace()[0].getMethodName();
        printResultStr(methodName, null,result);
    }

    @Test
    public void testGetAuthorsByEmail() throws Exception {
        Authors result = userService.authorsGetByEmail("panhainan@yeah.net");
        methodName=new Throwable().getStackTrace()[0].getMethodName();
        printResultStr(methodName, null,result);
    }
后面还有 1 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。