专业和学生关联
parent
82c8dee119
commit
e611f813fb
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dev": {
|
"dev": {
|
||||||
"baseURL": "http://localhost:9090/server/",
|
"baseURL": "http://localhost:9090/server/",
|
||||||
"session": "A8152C92D7491D57327FF765D2B6780C"
|
"session": "7375560290D5B4F661672990339E8898"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.ibeetl.jlw.web;
|
||||||
|
|
||||||
|
import base.BaseTest;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.test.web.servlet.RequestBuilder;
|
||||||
|
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||||
|
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||||
|
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author mlx
|
||||||
|
* @date 2022/10/24
|
||||||
|
* @modified
|
||||||
|
*/
|
||||||
|
class StudentControllerTest extends BaseTest {
|
||||||
|
|
||||||
|
private static final String MODEL = "/jlw/student";
|
||||||
|
private static final String API = "/api/student";
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPageList() throws Exception {
|
||||||
|
//构造请求参数
|
||||||
|
RequestBuilder rb = MockMvcRequestBuilders.post(API + "/getPageList.do")
|
||||||
|
.contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||||
|
.param("universitySystemId", "1569331621092564992");
|
||||||
|
|
||||||
|
//发送请求,验证返回结果
|
||||||
|
String result = mvc.perform(rb)
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value("0"))
|
||||||
|
.andReturn().getResponse().getContentAsString(Charset.defaultCharset());
|
||||||
|
|
||||||
|
System.out.println(result);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue