我有一个哈希Map,来自一个数据库,其中有一个大的十进制数。稍后,我尝试将这个十进制数与预期结果进行比较,得到一个bigdecimal,尽管强制转换它,但它不能转换为字符串。我想不出一个好办法让它正常工作。
ArrayList<HashMap<String, String>> dbResult = (ArrayList<HashMap<String, String>>)
(dbEngine.getDatabaseValue(conn, "select * from collateral_holding " +
"where collateral_account_id like 'RuthC26' " +
"AND asset_id = 'USDollar'; "));
MapValidator.compareArrayListOfHashMaps(dbResult,
new ReadTestDataFromCsv(TEST_DATA_PATH + "BDFWithNonUSDCurrency/"
+ "/expecteddata.csv", ',').getFile(),
Stream.of("quantity", "currency", "feed_currency").collect(Collectors.toSet()),
"Expected quanity, currency and feed currency data match");
2条答案
按热度按时间bybem2ql1#
试着实现代码的这一部分,这就是我在项目中实现它的方式,当然你必须改变变量,它是这么说的。
mdfafbf12#
我不确定,但我认为这就是你想要做的:
您可以这样使用它: