Feat: 实现根据基金 id 返回持仓以及净值信息
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
package cn.hezhaohui.fund.util;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@SpringBootTest
|
||||
class FundUtilTest {
|
||||
@Resource
|
||||
private FundUtil fundUtil;
|
||||
|
||||
@Test
|
||||
void getUrlByFundId() {
|
||||
@@ -12,4 +21,18 @@ class FundUtilTest {
|
||||
System.out.println(url);
|
||||
assertNotNull(url);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getWorthByFundId() {
|
||||
List<Map<String, String>> worth = fundUtil.getWorthByFundId("001068");
|
||||
Assert.notNull(worth);
|
||||
System.out.println(worth);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getHoldingsByFundId() {
|
||||
List<Map<String, String>> holdings = fundUtil.getHoldingsByFundId("001068");
|
||||
Assert.notNull(holdings);
|
||||
System.out.println(holdings);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user