签到的测试,需要传入日期,签到7天可获得更多的积分,

构造7天前的签到记录,重写签到方法,进行构造数据

import cn.com.acxiom.coty.api.ws.bean.dto.PointDetailRequest;
import cn.com.acxiom.coty.api.ws.bean.dto.SignInHisResponse;
import cn.com.acxiom.coty.api.ws.common.ResponseBean;
import cn.com.acxiom.coty.api.ws.service.PEService;
import cn.com.acxiom.coty.api.ws.service.SignInService;
import cn.com.acxiom.point.engine.domain.response.PointQueryDetail;
import com.alibaba.fastjson.JSONArray;
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.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List; @RunWith(SpringRunner.class)
@SpringBootTest
public class TestPE { @Autowired
PEService peService; @Autowired
SignInService signInService; @Test
//@Async
public void SignIn() throws Exception {
peService.sendEvent(500647, "coty.api.ws", "TMALLSIGNIN");
} @Test
public void CheckPEDetails() throws Exception { long dtLong = new Date().getTime();
System.out.println(dtLong);
ResponseBean<List<PointQueryDetail>> responseBean = new ResponseBean<List<PointQueryDetail>>();
PointDetailRequest pointDetailRequest = new PointDetailRequest();
pointDetailRequest.setEndDate("2019-12-12");
pointDetailRequest.setPageIndex(0);
pointDetailRequest.setPageSize(50);
pointDetailRequest.setStartDate("2019-01-01");
String social="AcxiomChina";
String user="VP巴黎恋人";
String sysName="Jasmine Test";
String pePointDetailCode= "POINTDETAIL_QUERY"; List<PointQueryDetail> pointQueryDetails = peService.findPointDetailByUser(social, user, sysName, pePointDetailCode, pointDetailRequest);
JSONArray jsonArray = (JSONArray) JSONArray.toJSON(pointQueryDetails);
responseBean.setData(pointQueryDetails);
System.out.println(jsonArray.toJSONString()); ; } @Test
public void Sign(){
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); int N =1;
while(N<25){
Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
ca.setTime(new Date()); //设置时间为当前时间
ca.add(Calendar.DATE, N);
long time= ca.getTime().getTime();
System.out.println(sd.format(time));
String social="AcxiomChina";
String userId="VP巴黎恋人"; SignInHisResponse signInHisResponse = signInService.tmallSignInWithTime(userId,social,time);
System.out.println("signInHisResponse是个啥"+signInHisResponse);
//JSONArray jsonArray = (JSONArray) JSONArray.toJSON(signInHisResponse);
//System.out.println(jsonArray.toJSONString());
N++;
} } }

  

Springboot中自已测试的更多相关文章

  1. Springboot的日志管理&Springboot整合Junit测试&Springboot中AOP的使用

    ==============Springboot的日志管理============= springboot无需引入日志的包,springboot默认已经依赖了slf4j.logback.log4j等日 ...

  2. springBoot中使用使用junit测试文件上传,以及文件下载接口编写

    本篇文章将介绍如何使junit在springBoot中测试文件的上传,首先先阅读如何在springBoot中进行接口测试. 文件上传操作测试代码 import org.junit.Before; im ...

  3. 测试开发专题:如何在spring-boot中进行参数校验

    上文我们讨论了spring-boot如何去获取前端传递过来的参数,那传递过来总不能直接使用,需要对这些参数进行校验,符合程序的要求才会进行下一步的处理,所以本篇文章我们主要讨论spring-boot中 ...

  4. springboot中swaggerUI的使用

    demo地址:demo-swagger-springboot springboot中swaggerUI的使用 1.pom文件中添加swagger依赖 2.从github项目中下载swaggerUI 然 ...

  5. 由浅入深学习springboot中使用redis

    很多时候,我们会在springboot中配置redis,但是就那么几个配置就配好了,没办法知道为什么,这里就详细的讲解一下 这里假设已经成功创建了一个springboot项目. redis连接工厂类 ...

  6. SpringBoot 中常用注解

    本篇博文将介绍几种SpringBoot 中常用注解 其中,各注解的作用为: @PathVaribale 获取url中的数据 @RequestParam 获取请求参数的值 @GetMapping 组合注 ...

  7. SpringBoot(四)SpringBoot中lombok使用

    lombok概述 lombok简介 Lombok想要解决了的是在我们实体Bean中大量的Getter/Setter方法,以及toString, hashCode等可能不会用到,但是某些时候仍然需要复写 ...

  8. SpringBoot 中常用注解@PathVaribale/@RequestParam/@GetMapping介绍

    SpringBoot 中常用注解@PathVaribale/@RequestParam/@GetMapping介绍 本篇博文将介绍几种如何处理url中的参数的注解@PathVaribale/@Requ ...

  9. springboot中配置过滤器以及可能出现的问题

    在springboot添加过滤器有两种方式: 1.通过创建FilterRegistrationBean的方式(建议使用此种方式,统一管理,且通过注解的方式若不是本地调试,如果在filter中需要增加c ...

随机推荐

  1. 用于抓取vijos所有题目信息的node.js脚本

    代码如下: var superagent = require('superagent'); var fs = require('fs'); /* fetch_vijos_problems 这个脚本用于 ...

  2. Tomcat启动原理/使用tomcat的应用是如何从tomcat的main函数开始运行的

    从main方法开始打断点,逐步调试,了解程序运行过程 全局唯一的public static void main(String[] args)main Springboot* 内置tomcat,开发的时 ...

  3. 使用SyncNavigator轻松实现数据库异地同步、断点续传、异构同步

    原文地址:https://blog.csdn.net/liushuijinger/article/details/7704410/ 最近一直在研究数据库同步的问题,在网上查了很多资料,也请教了很多人, ...

  4. 高级UI-滤镜和颜色通道

    滤镜在图片处理里面有很多的运用,尤其是相机使用了大量的滤镜,通过对颜色通道的调和,可以呈现出各种各样的效果 对图像进行一定的过滤加工处理,使用Paint设置滤镜效果 很多高级UI使用时候需要关闭硬件加 ...

  5. IDEA--IDEA debug断点调试技巧

      目录 一.Debug开篇 二.基本用法&快捷键 三.变量查看 四.计算表达式 五.智能步入 六.断点条件设置 七.多线程调试 八.回退断点 九.中断Debug Debug用来追踪代码的运行 ...

  6. SpringBoot+Mybatis+MySql 自动生成代码 自动分页

    一.配置文件 <!-- 通用mapper --> <dependency> <groupId>tk.mybatis</groupId> <arti ...

  7. 在ensp上利用单臂路由实验VLAN间路由

    我们为什么要设置单臂路由? 因为我们要解决不同vlan,不同网络的PC机间的通信问题~ 那它为啥叫单臂路由嘞? 单臂路由的原理时通过一台路由器,使vlan间互通数据通过路由器进行三层转发,如果在路由器 ...

  8. Linux中buff/cache内存占用过高解决办法

    在Linux系统中,我们经常用free命令来查看系统内存的使用状态.在一个centos7的系统上,free命令的显示内容大概是这样一个状态: 这个命令几乎是每一个使用过Linux的人必会的命令,但越是 ...

  9. 《游戏引擎构架Game Engine Architecture》略读笔记

    <游戏引擎构架Game Engine Architecture>略读笔记 分析标题作者 分析目录 选取感兴趣的章节阅读 25分钟略读完章节 分析标题作者 此书是一本帮助人入行做游戏的书,也 ...

  10. vue3 父组件给子组件传值 provide & inject

    介绍 provide() 和 inject() 可以实现嵌套组件之间的数据传递. 这两个函数只能在 setup() 函数中使用. 父级组件中使用 provide() 函数向下传递数据. 子级组件中使用 ...