Feat: 实现根据基金 id 返回持仓以及净值信息

This commit is contained in:
2025-10-16 23:23:39 +08:00
parent 6f5884af2b
commit e2d5c39805
2 changed files with 48 additions and 0 deletions
@@ -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);
}
}