package com.bailuntec.job;

import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.support.PointJob;
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;

/**
 * <p>
 *
 * </p>
 *
 * @author robbendev
 * @since 2020/9/2 11:54 上午
 */
public class SyncCostFirstFinishJobTest {


    @Test
    public void test() {
        SyncCostFirstFinishJob syncCostFirstFinishJob = new SyncCostFirstFinishJob();
        JobPointLog jobPointLog = new JobPointLog("base-sync-cost-first-finish", 1, 1000, 1, 1,
                LocalDateTime.of(2020, 8, 1, 0, 0, 0),
                LocalDateTime.of(2020, 10, 10, 0, 0, 0));
        syncCostFirstFinishJob.executeJob(null, jobPointLog);
    }

    @Test
    public void test2() {
        PointJob syncCostFirstFinishJob = new SyncCostFirstFinishJob();

        ShardingContext job = new ShardingContext(new ShardingContexts("1", "base-sync-cost-first-finish", 1, "", new HashMap<>()), 0);

        syncCostFirstFinishJob.execute(job);
    }

}
