签到的测试,需要传入日期,签到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. [简短问答]LODOP套打问题及相关

    该博文为简短问答,具体详细介绍可查看本博客的相关博文,套打及位置相关详细博文:LODOP中的各种宽高和位置简短问答.LODOP不同打印机出现偏移问题.Lodop打印控件打印机可打区域的影响 设置纸张边 ...

  2. [LeetCode] 254. Factor Combinations 因子组合

    Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a func ...

  3. kexue shangwang

    根据实践,pptp.IPsec甚至OpenVPN等kexue上网法已经无法顺利翻越GFW.通过抓包可知,GFW会将pptp的握手期间的ack包吞掉,导致本地一直无法收到服务器端的响应.而OpenVPN ...

  4. 使用二进制的方式部署 K8S-1.16 高可用集群

    一.项目介绍 项目致力于让有意向使用原生kubernetes集群的企业或个人,可以方便的.系统的使用二进制的方式手工搭建kubernetes高可用集群.并且让相关的人员可以更好的理解kubernete ...

  5. [转帖]比特币本质其实是UTXO

    比特币本质其实是UTXO https://www.jianshu.com/p/7071e68c5262 其实并没有什么比特币,我们在交易所里或者钱包里显示的比特币余额其实是UTXO.那到底什么是UTX ...

  6. 转载:c++获取本机IP地址

    windows下获取IP地址的两种方法: 一种可以获取IPv4和IPv6,但是需要WSAStartup: 一种只能取到IPv4,但是不需要WSAStartup: 如下: 方法一:(可以获取IPv4和I ...

  7. SQL——IN操作符

    一.IN操作符基本用法 IN操作符用于在WHERE字句中规定多个值. 语法格式如下: SELECT 列名1,列名2... FROM 表名 WHERE 列名 IN(值1,值2...); 示例studen ...

  8. GOF 的23种JAVA常用设计模式总结 03 面向对象七大设计原则

    在软件开发中,为了提高软件系统的可维护性和可复用性,增加软件的可扩展性和灵活性,程序员要尽量根据 7 条原则来开发程序,从而提高软件开发效率.节约软件开发成本和维护成本. 各位代码界的大佬们总结出的七 ...

  9. jdk安装以及Java环境配置

    jdk其实自己大一的时候就已经装过,java环境也配置过,但是随着后面学习的东西越来越多,要安装的软件也越来越多,一开始没有安装路径的概念,好多东西都放的很乱.接着这次自己复习java的机会,于是重新 ...

  10. 搭建SpriBoot开发环境

      一.搭建springboot开发环境 需求:使用springboot搭建一个项目,编写一个controller控制器,使用浏览器正常访问 springboot1.x版本--> 基于sprin ...