package quant.rich.emoney;

import java.util.List;

import org.junit.jupiter.api.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.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import lombok.extern.slf4j.Slf4j;
import quant.rich.emoney.tushare.StockInfo;
import quant.rich.emoney.tushare.TushareDataServiceClient;

/**
 * 测试通过 Feign 从 tushare-data-service 获取数据
 * @see TushareDataServiceClient
 */
@SpringBootTest
@ContextConfiguration(classes = EmoneyAutoApplication.class)
@RunWith(SpringJUnit4ClassRunner.class)
@Slf4j
public class TushareDataServiceClientTest {
    
    @Autowired
    TushareDataServiceClient tushareDataServiceClient;
    
    @Test
    void test() {
        List<StockInfo> stockInfos = tushareDataServiceClient.list("LIST", new String[] {"SZ", "SH"}, null);
        for(StockInfo stockInfo : stockInfos) {
            log.info("{} {}", stockInfo.getGoodsId(), stockInfo);
        }
    }

}
