package com.quantgroup.asset.distribution.fund;

import com.alibaba.fastjson.JSON;
import com.quantgroup.asset.distribution.model.entity.fund.FundConfigSimulationVO;
import com.quantgroup.asset.distribution.model.response.GlobalResponse;
import com.quantgroup.asset.distribution.service.funding.IFundModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.quantgroup.asset.distribution.AssetDistributionBootstrap;
import com.quantgroup.asset.distribution.service.funding.IFundModuleChannelFundConfigService;
import com.quantgroup.asset.distribution.service.jpa.entity.FundModuleChannelFundConfig;

import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = AssetDistributionBootstrap.class)
public class FundModuleTest {
	
	@Autowired
	private IFundModuleChannelFundConfigService channelFundConfigService;
	@Autowired
	private IFundModuleService service;
	
	@Test
	public void testFindBy() {
//		FundModuleChannelFundConfig config = channelFundConfigService.findByBizChannel("1");
//		System.out.println(config);
		System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", null, 0, 20));
		System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", 140L, 0, 20));
//		System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", null, 0, 20));
//		System.out.println(channelFundConfigService.getChannelFundConfigsByChannelOrFundId("1", null, 0, 20));
	}

	@Test
	public void testS(){
		FundConfigSimulationVO vo = (FundConfigSimulationVO) service.getAllConditionsOfFundConfig(50L).getBody();
		GlobalResponse response = service.simulationCases(vo.getConditionsCase(),50L);
		System.out.println(JSON.toJSONString(response));
	}
}
