签到的测试,需要传入日期,签到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. 【LeetCode算法-38】Count and Say

    LeetCode第38题 The count-and-say sequence is the sequence of integers with the first five terms as fol ...

  2. [LeetCode] 213. House Robber II 打家劫舍 II

    Note: This is an extension of House Robber. After robbing those houses on that street, the thief has ...

  3. 8、2 es数据库的使用

    1.注意问题.es和redis同时使用会报错 解决: package com.bw; import org.springframework.beans.factory.InitializingBean ...

  4. Visual Studio特性学习

    官方档案: https://docs.microsoft.com/en-us/visualstudio/get-started/visual-studio-ide?view=vs-2019

  5. ubuntu18.04LTS服务器安装matlab4a

    下载matlab安装文件共包含三个文件:MATHWORKS_R2014A.part1.rar, MATHWORKS_R2014A.part2.rar, 相关文件(Crack)解压:$sudo apt ...

  6. Python之 random 模块

    #!/usr/bin/env python # -*- coding:utf8 -*- import random ''' 如果想要随机的内容的话,就可以使用这个模块来完成 ''' ######### ...

  7. leetcode两数相加

    题目描述:给出两个 非空 的链表用来表示两个非负的整数.其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字. 如果,我们将这两个数相加起来,则会返回一个新的链表来表 ...

  8. [CF724G]Xor-matic Number of the Graph

    题目大意:有一张$n$个点$m$条边的无向图,定义三元组$(u,v,s)$是有趣的,当且仅当有一条$u\to v$的路径,路径上所有边的异或和为$s$.问所有有趣的三元组的$s$之和.$n\leqsl ...

  9. golang ---获取磁盘信息

    package main import ( "fmt" "github.com/StackExchange/wmi" ) type Storage struct ...

  10. Harbor仓库配置https访问

    注:高版本(14以上)docker执行login命令,默认使用https,且harbor必须使用域名,只是用ip访问是不行的. 假设使用的网址是:www.harbor.mobi,本机ip是192.16 ...