Browse Source

骄阳测试用例提交

yumeng 5 years ago
parent
commit
e174a106ac
1 changed files with 22 additions and 20 deletions
  1. 22 20
      jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

+ 22 - 20
jeecg-boot-module-system/src/test/java/org/jeecg/SampleTest.java

@@ -8,7 +8,6 @@ import cn.com.ctop.common.module.entity.CtopOauthToken;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.entity.UserAllocation;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.message.handle.impl.EmailSendMsgHandle;
 import cn.com.ctop.common.module.service.*;
 import cn.com.ctop.common.module.service.*;
-import cn.com.ctop.common.module.utils.CorpWexinUtils;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.common.module.utils.CtopAdConstant;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouHistoryReportTaskService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
 import cn.com.ctop.kuaishou.modules.graphql.service.IKuaishouWebInterfaceService;
@@ -17,7 +16,6 @@ import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataServ
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IBytedanceReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.xxl.job.core.log.XxlJobLogger;
 import com.xxl.job.core.log.XxlJobLogger;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.DateUtils;
@@ -53,10 +51,13 @@ public class SampleTest {
 
 
     @Autowired
     @Autowired
     private ICtopOauthTokenService tokenService;
     private ICtopOauthTokenService tokenService;
+    @Autowired
+    private IRefreshTokenService refreshTokenService;
+
 
 
     @Test
     @Test
     public void loadBytedanceCreativeData() {
     public void loadBytedanceCreativeData() {
-        CorpWexinUtils.sendMessageByWeChatId("ZhaoWang","测试企业微信发送消息");
+        refreshTokenService.getKuaiShouRefresh();
     }
     }
 
 
     @Test
     @Test
@@ -125,10 +126,10 @@ public class SampleTest {
         List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
         List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
         for (UserAllocation allocation : allocations) {
         for (UserAllocation allocation : allocations) {
 //            for (int i = 2; i < 10; i++) {
 //            for (int i = 2; i < 10; i++) {
-                CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
-                Date getDate = DateUtils.addDay(new Date(), 0);
+            CtopOauthToken token = oauthTokenService.getTokenByAccountId(allocation.getAccountId());
+            Date getDate = DateUtils.addDay(new Date(), 0);
 //                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
 //                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
+            reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_HOURLY);
 //            }
 //            }
         }
         }
     }
     }
@@ -169,11 +170,11 @@ public class SampleTest {
     public void loadAccountData() {
     public void loadAccountData() {
 //        List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
 //        List<UserAllocation> allocations = allocationService.getByParams(776L,null,0);
 //        for (UserAllocation allocation:allocations) {
 //        for (UserAllocation allocation:allocations) {
-            CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
-            for(int i=92;i<100;i++){
-                Date getDate = DateUtils.addDay(new Date(),-i);
-                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
-            }
+        CtopOauthToken token = tokenService.getTokenByAccountId(93238965516L);
+        for (int i = 92; i < 100; i++) {
+            Date getDate = DateUtils.addDay(new Date(), -i);
+            reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+        }
 //        }
 //        }
     }
     }
 
 
@@ -185,20 +186,20 @@ public class SampleTest {
     IUReportService uReportService;
     IUReportService uReportService;
 
 
     @Test
     @Test
-    public void loadBytedanceData(){
-        List<UserAllocation>allocations = allocationService.getByParams(633L,null,0);
-        for (int i=0;i<allocations.size();i++) {
+    public void loadBytedanceData() {
+        List<UserAllocation> allocations = allocationService.getByParams(633L, null, 0);
+        for (int i = 0; i < allocations.size(); i++) {
             CtopOauthToken token = tokenService.getTokenByAccountId(allocations.get(i).getAccountId());
             CtopOauthToken token = tokenService.getTokenByAccountId(allocations.get(i).getAccountId());
-            for(int j=10;j<110;j++){
+            for (int j = 10; j < 110; j++) {
                 Date getDate = DateUtils.addDay(new Date(), -j);
                 Date getDate = DateUtils.addDay(new Date(), -j);
-                reportService.getAdvertiserReport(token, getDate, getDate,CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
+                reportService.getAdvertiserReport(token, getDate, getDate, CtopAdConstant.BYTEDANCE_REPORT_TYPE_DAILY);
             }
             }
         }
         }
     }
     }
 
 
     @Test
     @Test
-    public void loaddata(){
-        for(int i=0;i<30;i++){
+    public void loaddata() {
+        for (int i = 0; i < 30; i++) {
             Date getDate = DateUtils.addDay(new Date(), -i);
             Date getDate = DateUtils.addDay(new Date(), -i);
             String date = DateUtils.formatDate(getDate);
             String date = DateUtils.formatDate(getDate);
             videoReportDailyService.videoInfoList(date, date);
             videoReportDailyService.videoInfoList(date, date);
@@ -210,9 +211,10 @@ public class SampleTest {
 
 
     @Autowired
     @Autowired
     private IByteDanceVideoReportDailyService videoReportDailyService;
     private IByteDanceVideoReportDailyService videoReportDailyService;
+
     @Test
     @Test
-    public void loadMatData(){
-        List<UserAllocation> allocations = allocationService.getByParams(320L,null,0);
+    public void loadMatData() {
+        List<UserAllocation> allocations = allocationService.getByParams(320L, null, 0);
         countDownLatch = new CountDownLatch(allocations.size());
         countDownLatch = new CountDownLatch(allocations.size());
         executorService = Executors.newFixedThreadPool(2);
         executorService = Executors.newFixedThreadPool(2);
         allocations.forEach(allocation -> {
         allocations.forEach(allocation -> {