import com.bailuntec.domain.entity.JobAccountLog;
import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.job.EbayFinanceSyncJob;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.executor.ShardingContexts;
import org.junit.jupiter.api.Test;

import java.time.LocalDateTime;
import java.util.HashMap;

public class EbayFinanceSyncJobTest {

    @Test
    public void test3() {
        EbayFinanceSyncJob skuSyncJob = new EbayFinanceSyncJob();
        ShardingContext job = new ShardingContext(new ShardingContexts("1", "job", 3, "", new HashMap<>()), 2);
        skuSyncJob.executeJob(job, new JobPointLog("",null ,100,1,1, LocalDateTime.now().minusMonths(1),LocalDateTime.now().minusDays(29)));

    }


    @Test
    public void test1() {
        EbayFinanceSyncJob skuSyncJob = new EbayFinanceSyncJob();
        ShardingContext job = new ShardingContext(new ShardingContexts("1", "job", 3, "", new HashMap<>()), 1);
        JobAccountLog jobAccountLog = new JobAccountLog();
        jobAccountLog.setAccountId(1861);
        jobAccountLog.setStartTime(LocalDateTime.of(2019,05,01,0,0));
        jobAccountLog.setEndTime(LocalDateTime.of(2019,06,02,0,0));
        jobAccountLog.setIntervalTime(1);
        jobAccountLog.setPageIndex(1);
        jobAccountLog.setPageSize(100);
        skuSyncJob.callSaasApi(jobAccountLog);

    }

}
