package test.com.leanwo;

import org.junit.jupiter.api.BeforeEach;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BaseTest {
    protected static final Logger logger =  LoggerFactory.getLogger(BaseTest.class);
    
    /** 测试登录的用户名 */
    private static final String userName = "admin";
    
    /** 测试登录的密码 */
    private static final String password = "admin";

    
    @BeforeEach
    public void init() {
        LoginResourceTest loginResource = new LoginResourceTest();
        String token = loginResource.login(userName, password);
        if((token != null && token.length() > 0)) {
            logger.info("登录成功。");
        };
        BaseRestTemplateTest.setToken(token);
    }
}
