修改登录API逻辑
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.guo.learningprogresstracker.controller;
|
||||
|
||||
import com.guo.learningprogresstracker.domain.entity.CommonResult;
|
||||
import com.guo.learningprogresstracker.domain.model.LoginBody;
|
||||
import com.guo.learningprogresstracker.exception.AppException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@SpringBootTest
|
||||
class LoginControllerTest {
|
||||
|
||||
@Autowired
|
||||
private LoginController loginController;
|
||||
|
||||
@Test
|
||||
void login() throws AppException {
|
||||
LoginBody loginBody = new LoginBody();
|
||||
loginBody.setUsername("admin");
|
||||
loginBody.setPassword("admin");
|
||||
CommonResult<Object> login = loginController.login(loginBody);
|
||||
assertEquals(login.getMessage(), "登录成功!");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void loingOut() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user