import com.bailuntec.domain.entity.JobPointLog;
import com.bailuntec.job.SyncPurchaseAimsJob;
import com.bailuntec.job.SyncPurchaseDetailsJob;
import com.bailuntec.job.SyncSemiPurchaseDetailsJob;
import com.bailuntec.job.SyncSemiPurchaseOldDetailsJob;
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;

public class SyncPurchaseDetailsTest {

    @Test
    public void test() {
        SyncPurchaseDetailsJob syncPurchaseDetailsJob = new SyncPurchaseDetailsJob();
        syncPurchaseDetailsJob.executeJob(null, new JobPointLog("base-purchase-details", 1, 1000, 0, 1,
                LocalDateTime.of(2020, 3, 1, 0, 0),
                LocalDateTime.of(2020, 3, 15, 0, 0)));
    }

    @Test
    public void test1() {
        SyncPurchaseAimsJob syncPurchaseAimsJob = new SyncPurchaseAimsJob();
        syncPurchaseAimsJob.executeJob(null, new JobPointLog("test", 1, 100, 0, 1,
                LocalDateTime.of(2018, 12, 25, 0, 0),
                LocalDateTime.of(2018, 12, 26, 0, 0)));
    }

    @Test
    public void test2() {
        SyncSemiPurchaseDetailsJob syncSemiPurchaseDetailsJob = new SyncSemiPurchaseDetailsJob();
        syncSemiPurchaseDetailsJob.executeJob(null, new JobPointLog("test1", 1, 100, 0, 1,
                LocalDateTime.of(2020, 4, 10, 0, 0),
                LocalDateTime.of(2020, 4, 28, 0, 0)));
    }

    @Test
    public void test3() {
        PointJob pointJob = new SyncSemiPurchaseOldDetailsJob();
        pointJob.execute(new ShardingContext(new ShardingContexts("x", "semi-purchase-details-info-old", 1, null, new HashMap<>()), 0));
    }

}
