增加去重接口类
parent
7e778724f3
commit
e75f167d21
@ -0,0 +1,43 @@
|
|||||||
|
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/17
|
||||||
|
* @modified
|
||||||
|
*/
|
||||||
|
class CourseLabelControllerTest extends BaseTest {
|
||||||
|
|
||||||
|
private static final String MODEL = "/jlw/courseLabel";
|
||||||
|
private static final String API = "/api/courseLabel";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void disLabelType() throws Exception {
|
||||||
|
//构造请求参数
|
||||||
|
RequestBuilder rb = MockMvcRequestBuilders.post(MODEL + "/disLabelType.json")
|
||||||
|
.contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
||||||
|
|
||||||
|
|
||||||
|
//发送请求,验证返回结果
|
||||||
|
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