code optimize

2.3.1
xuxueli 3 years ago
parent 3abdfc6e2f
commit 0931df7153

@ -3,6 +3,8 @@ package com.xxl.job.admin.controller;
import com.xxl.job.admin.service.LoginService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.LinkedMultiValueMap;
@ -13,6 +15,7 @@ import javax.servlet.http.Cookie;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
public class JobInfoControllerTest extends AbstractSpringMvcTest {
private static Logger logger = LoggerFactory.getLogger(JobInfoControllerTest.class);
private Cookie cookie;
@ -41,7 +44,7 @@ public class JobInfoControllerTest extends AbstractSpringMvcTest {
.cookie(cookie)
).andReturn();
System.out.println(ret.getResponse().getContentAsString());
logger.info(ret.getResponse().getContentAsString());
}
}

@ -4,6 +4,8 @@ import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.scheduler.MisfireStrategyEnum;
import com.xxl.job.admin.core.scheduler.ScheduleTypeEnum;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
@ -12,6 +14,7 @@ import java.util.List;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class XxlJobInfoDaoTest {
private static Logger logger = LoggerFactory.getLogger(XxlJobInfoDaoTest.class);
@Resource
private XxlJobInfoDao xxlJobInfoDao;
@ -20,9 +23,9 @@ public class XxlJobInfoDaoTest {
public void pageList(){
List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, -1, null, null, null);
int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, -1, null, null, null);
System.out.println(list);
System.out.println(list_count);
logger.info("", list);
logger.info("", list_count);
List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
}

@ -2,6 +2,8 @@ package com.xxl.job.admin.util;
import com.xxl.job.admin.core.util.I18nUtil;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
/**
@ -11,12 +13,13 @@ import org.springframework.boot.test.context.SpringBootTest;
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class I18nUtilTest {
private static Logger logger = LoggerFactory.getLogger(I18nUtilTest.class);
@Test
public void test(){
System.out.println(I18nUtil.getString("admin_name"));
System.out.println(I18nUtil.getMultString("admin_name", "admin_name_full"));
System.out.println(I18nUtil.getMultString());
logger.info(I18nUtil.getString("admin_name"));
logger.info(I18nUtil.getMultString("admin_name", "admin_name_full"));
logger.info(I18nUtil.getMultString());
}
}

Loading…
Cancel
Save