update
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
package org.jeecg.modules.message.test;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.api.dto.message.BusMessageDTO;
|
||||
import org.jeecg.common.api.dto.message.BusTemplateMessageDTO;
|
||||
import org.jeecg.common.api.dto.message.MessageDTO;
|
||||
import org.jeecg.common.api.dto.message.TemplateMessageDTO;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.constant.enums.DySmsEnum;
|
||||
import org.jeecg.common.constant.enums.EmailTemplateEnum;
|
||||
import org.jeecg.common.constant.enums.MessageTypeEnum;
|
||||
import org.jeecg.common.constant.enums.SysAnnmentTypeEnum;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.common.util.DySmsHelper;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 消息推送测试
|
||||
* @Author: lsq
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = JeecgSystemApplication.class)
|
||||
public class SendMessageTest {
|
||||
|
||||
@Autowired
|
||||
ISysBaseAPI sysBaseAPI;
|
||||
|
||||
/**
|
||||
* 发送系统消息
|
||||
*/
|
||||
@Test
|
||||
public void sendSysAnnouncement() {
|
||||
//发送人
|
||||
String fromUser = "admin";
|
||||
//接收人
|
||||
String toUser = "jeecg";
|
||||
//标题
|
||||
String title = "系统消息";
|
||||
//内容
|
||||
String msgContent = "TEST:今日份日程计划已送达!";
|
||||
//发送系统消息
|
||||
sysBaseAPI.sendSysAnnouncement(new MessageDTO(fromUser, toUser, title, msgContent));
|
||||
//消息类型
|
||||
String msgCategory = CommonConstant.MSG_CATEGORY_1;
|
||||
//业务类型
|
||||
String busType = SysAnnmentTypeEnum.EMAIL.getType();
|
||||
//业务ID
|
||||
String busId = "11111";
|
||||
//发送带业务参数的系统消息
|
||||
BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType,busId);
|
||||
sysBaseAPI.sendBusAnnouncement(busMessageDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送模版消息
|
||||
*/
|
||||
@Test
|
||||
public void sendTemplateAnnouncement() {
|
||||
//发送人
|
||||
String fromUser = "admin";
|
||||
//接收人
|
||||
String toUser = "jeecg";
|
||||
//标题
|
||||
String title = "通知公告";
|
||||
//模版编码
|
||||
String templateCode = "412358";
|
||||
//模版参数
|
||||
Map templateParam = new HashMap<>();
|
||||
templateParam.put("realname","JEECG用户");
|
||||
sysBaseAPI.sendTemplateAnnouncement(new TemplateMessageDTO(fromUser,toUser,title,templateParam,templateCode));
|
||||
//业务类型
|
||||
String busType = SysAnnmentTypeEnum.EMAIL.getType();
|
||||
//业务ID
|
||||
String busId = "11111";
|
||||
//发送带业务参数的模版消息
|
||||
BusTemplateMessageDTO busMessageDTO = new BusTemplateMessageDTO(fromUser, toUser, title, templateParam ,templateCode, busType,busId);
|
||||
sysBaseAPI.sendBusTemplateAnnouncement(busMessageDTO);
|
||||
//新发送模版消息
|
||||
MessageDTO messageDTO = new MessageDTO();
|
||||
messageDTO.setType(MessageTypeEnum.XT.getType());
|
||||
messageDTO.setToAll(false);
|
||||
messageDTO.setToUser(toUser);
|
||||
messageDTO.setTitle("【流程错误】");
|
||||
messageDTO.setFromUser("admin");
|
||||
HashMap data = new HashMap<>();
|
||||
data.put(CommonConstant.NOTICE_MSG_BUS_TYPE, "msg_node");
|
||||
messageDTO.setData(data);
|
||||
messageDTO.setContent("TEST:流程执行失败!任务节点未找到");
|
||||
sysBaseAPI.sendTemplateMessage(messageDTO);
|
||||
}
|
||||
/**
|
||||
* 发送邮件
|
||||
*/
|
||||
@Test
|
||||
public void sendEmailMsg() {
|
||||
String title = "【日程提醒】您的日程任务即将开始";
|
||||
String content = "TEST:尊敬的王先生,您购买的演唱会将于本周日10:08分在国家大剧院如期举行,届时请携带好您的门票和身份证到场";
|
||||
String email = "250678106@qq.com";
|
||||
sysBaseAPI.sendEmailMsg(email,title,content);
|
||||
}
|
||||
/**
|
||||
* 发送html模版邮件
|
||||
*/
|
||||
@Test
|
||||
public void sendTemplateEmailMsg() {
|
||||
String title = "收到一个催办";
|
||||
String email = "250678106@qq.com";
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("bpm_name","高级设置");
|
||||
params.put("bpm_task","审批人");
|
||||
params.put("datetime","2023-10-07 18:00:49");
|
||||
params.put("url","http://boot3.jeecg.com/message/template");
|
||||
params.put("remark","快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点");
|
||||
sysBaseAPI.sendHtmlTemplateEmail(email,title, EmailTemplateEnum.BPM_CUIBAN_EMAIL,params);
|
||||
}
|
||||
/**
|
||||
* 发送短信
|
||||
*/
|
||||
@Test
|
||||
public void sendSms() throws ClientException {
|
||||
//手机号
|
||||
String mobile = "159***";
|
||||
//消息模版
|
||||
DySmsEnum templateCode = DySmsEnum.LOGIN_TEMPLATE_CODE;
|
||||
//模版所需参数
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("code", "4XDP");
|
||||
DySmsHelper.sendSms(mobile, obj, templateCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.jeecg.modules.system.test;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* 系统用户单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
public class InsertDemoTest {
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
*/
|
||||
private final String BASE_URL = "http://localhost:8080/jeecg-boot//test/jeecgDemo/";
|
||||
//测试:用户名和密码
|
||||
private final String USERNAME = "admin";
|
||||
private final String PASSWORD = "123456";
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 测试用例:新增
|
||||
*/
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 请求地址
|
||||
String url = BASE_URL + "add" ;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
HttpMethod method = HttpMethod.POST;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
String name = "李哈哈" + i;
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("name", name);
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String getToken() {
|
||||
String token = JwtUtil.sign(USERNAME, PASSWORD);
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 60);
|
||||
return token;
|
||||
}
|
||||
|
||||
private HttpHeaders getHeaders() {
|
||||
String token = this.getToken();
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String mediaType = MediaType.APPLICATION_JSON_VALUE;
|
||||
headers.setContentType(MediaType.parseMediaType(mediaType));
|
||||
headers.set("Accept", mediaType);
|
||||
headers.set("X-Access-Token", token);
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.jeecg.modules.system.test;
|
||||
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.modules.demo.mock.MockController;
|
||||
import org.jeecg.modules.demo.test.entity.JeecgDemo;
|
||||
import org.jeecg.modules.demo.test.mapper.JeecgDemoMapper;
|
||||
import org.jeecg.modules.demo.test.service.IJeecgDemoService;
|
||||
import org.jeecg.modules.system.service.ISysDataLogService;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
public class SampleTest {
|
||||
|
||||
@Resource
|
||||
private JeecgDemoMapper jeecgDemoMapper;
|
||||
@Resource
|
||||
private IJeecgDemoService jeecgDemoService;
|
||||
@Resource
|
||||
private ISysDataLogService sysDataLogService;
|
||||
@Resource
|
||||
private MockController mock;
|
||||
|
||||
@Test
|
||||
public void testSelect() {
|
||||
System.out.println(("----- selectAll method test ------"));
|
||||
List<JeecgDemo> userList = jeecgDemoMapper.selectList(null);
|
||||
Assert.assertEquals(5, userList.size());
|
||||
userList.forEach(System.out::println);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testXmlSql() {
|
||||
System.out.println(("----- selectAll method test ------"));
|
||||
List<JeecgDemo> userList = jeecgDemoMapper.getDemoByName("Sandy12");
|
||||
userList.forEach(System.out::println);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试事务
|
||||
*/
|
||||
@Test
|
||||
public void testTran() {
|
||||
jeecgDemoService.testTran();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试数据日志添加
|
||||
*/
|
||||
@Test
|
||||
public void testDataLogSave() {
|
||||
System.out.println(("----- datalog test ------"));
|
||||
String tableName = "jeecg_demo";
|
||||
String dataId = "4028ef81550c1a7901550c1cd6e70001";
|
||||
String dataContent = mock.sysDataLogJson();
|
||||
sysDataLogService.addDataLog(tableName, dataId, dataContent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package org.jeecg.modules.system.test;
|
||||
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.jeecg.config.JeecgBaseConfig;
|
||||
import org.jeecg.config.firewall.SqlInjection.IDictTableWhiteListHandler;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* @Description: 系统表白名单测试
|
||||
* @Author: sunjianlei
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = JeecgSystemApplication.class)
|
||||
public class SysTableWhiteCheckTest {
|
||||
|
||||
@Autowired
|
||||
IDictTableWhiteListHandler whiteListHandler;
|
||||
@Autowired
|
||||
ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Autowired
|
||||
JeecgBaseConfig jeecgBaseConfig;
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
String lowCodeMode = this.jeecgBaseConfig.getFirewall().getLowCodeMode();
|
||||
System.out.println("当前 LowCode 模式为: " + lowCodeMode);
|
||||
// 清空缓存,防止影响测试
|
||||
whiteListHandler.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSql() {
|
||||
System.out.println("=== 开始测试 SQL 方式 ===");
|
||||
String[] sqlArr = new String[]{
|
||||
"select username from sys_user",
|
||||
"select username, CONCAT(realname, SEX) from SYS_USER",
|
||||
"select username, CONCAT(realname, sex) from sys_user",
|
||||
};
|
||||
for (String sql : sqlArr) {
|
||||
System.out.println("- 测试Sql: " + sql);
|
||||
try {
|
||||
sysBaseAPI.dictTableWhiteListCheckBySql(sql);
|
||||
System.out.println("-- 测试通过");
|
||||
} catch (Exception e) {
|
||||
System.out.println("-- 测试未通过: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
System.out.println("=== 结束测试 SQL 方式 ===");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDict() {
|
||||
System.out.println("=== 开始测试 DICT 方式 ===");
|
||||
|
||||
String table = "sys_user";
|
||||
String code = "username";
|
||||
String text = "realname";
|
||||
this.testDict(table, code, text);
|
||||
|
||||
table = "sys_user";
|
||||
code = "username";
|
||||
text = "CONCAT(realname, sex)";
|
||||
this.testDict(table, code, text);
|
||||
|
||||
table = "SYS_USER";
|
||||
code = "username";
|
||||
text = "CONCAT(realname, SEX)";
|
||||
this.testDict(table, code, text);
|
||||
|
||||
System.out.println("=== 结束测试 DICT 方式 ===");
|
||||
}
|
||||
|
||||
private void testDict(String table, String code, String text) {
|
||||
try {
|
||||
sysBaseAPI.dictTableWhiteListCheckByDict(table, code, text);
|
||||
System.out.println("- 测试通过");
|
||||
} catch (Exception e) {
|
||||
System.out.println("- 测试未通过: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.jeecg.modules.system.test;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.jeecg.JeecgSystemApplication;
|
||||
import org.jeecg.common.constant.CommonConstant;
|
||||
import org.jeecg.common.system.util.JwtUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.common.util.RestUtil;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
/**
|
||||
* 系统用户单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = JeecgSystemApplication.class)
|
||||
public class SysUserTest {
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
*/
|
||||
private final String BASE_URL = "http://localhost:8080/jeecg-boot/sys/user/";
|
||||
//测试:用户名和密码
|
||||
private final String USERNAME = "admin";
|
||||
private final String PASSWORD = "123456";
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
* 测试用例:查询记录
|
||||
*/
|
||||
@Test
|
||||
public void testQuery() {
|
||||
// 请求地址
|
||||
String url = BASE_URL + "list";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 GET 代表获取数据
|
||||
HttpMethod method = HttpMethod.GET;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用例:新增
|
||||
*/
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 请求地址
|
||||
String url = BASE_URL + "add" ;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
HttpMethod method = HttpMethod.POST;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("password", "123456");
|
||||
params.put("confirmpassword","123456");
|
||||
params.put("realname", "单元测试");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:修改
|
||||
*/
|
||||
@Test
|
||||
public void testEdit() {
|
||||
// 数据Id
|
||||
String dataId = "1331795062924374018";
|
||||
// 请求地址
|
||||
String url = BASE_URL + "edit";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 PUT 代表提交修改数据
|
||||
HttpMethod method = HttpMethod.PUT;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("realname", "单元测试1111");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
params.put("id",dataId);
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, params, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测试用例:删除
|
||||
*/
|
||||
@Test
|
||||
public void testDelete() {
|
||||
// 数据Id
|
||||
String dataId = "1331795062924374018";
|
||||
// 请求地址
|
||||
String url = BASE_URL + "delete" + "?id=" + dataId;
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 DELETE 代表删除数据
|
||||
HttpMethod method = HttpMethod.DELETE;
|
||||
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
// 利用 RestUtil 请求该url
|
||||
ResponseEntity<JSONObject> result = RestUtil.request(url, method, headers, null, null, JSONObject.class);
|
||||
if (result != null && result.getBody() != null) {
|
||||
System.out.println("返回结果:" + result.getBody().toJSONString());
|
||||
} else {
|
||||
System.out.println("查询失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String getToken() {
|
||||
String token = JwtUtil.sign(USERNAME, PASSWORD);
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, 60);
|
||||
return token;
|
||||
}
|
||||
|
||||
private HttpHeaders getHeaders() {
|
||||
String token = this.getToken();
|
||||
System.out.println("请求Token:" + token);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
String mediaType = MediaType.APPLICATION_JSON_VALUE;
|
||||
headers.setContentType(MediaType.parseMediaType(mediaType));
|
||||
headers.set("Accept", mediaType);
|
||||
headers.set("X-Access-Token", token);
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user