package com.crm.ib.task.service;

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.SpringJUnit4ClassRunner;

import java.util.Date;
import java.util.Map;

/**
 * @author y
 * @create 2022/5/5
 */
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class DailyTradeServiceTest {

    @Autowired
    private DailyTradeService dailyTradeService;
    @Autowired
    private DailyConfigService dailyConfigService;


    @Test
    public void calc() {
        try {

            final Map<String, Date> configs;
            try {
                configs = dailyConfigService.getConfigMap();
                if (configs == null) {
                    return;
                }

                dailyTradeService.calc(configs);
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
