PasteUs/PasteMeAdmin

Test fail because of something I don't know

LucienShui opened this issue · 1 comments

Source Version: LucienShui/PasteMeAdmin@c7cab2a

When running mvn test:

java.lang.ClassCastException: class com.alibaba.fastjson.JSONObject cannot be cast to class cn.pasteme.algorithm.pair.Pair (com.alibaba.fastjson.JSONObject and cn.pasteme.algorithm.pair.Pair are in unnamed module of loader 'app')
	at cn.pasteme.admin.mapper.test.AdminMapperTests.assertPairListEquals(AdminMapperTests.java:82)
	at cn.pasteme.admin.mapper.test.AdminMapperTests.riskCheckResultMapperTest(AdminMapperTests.java:136)

When insert RiskCheckResultDO into database, mapper transfer result field into JSON string first, then save it to JSON type field in database.

But when select DO from database, the real data in RiskCheckResultDO.result field become List<JSONObject> type instead of List<Pair<String, Long>>, here is the question I have.

Here is the code: AdminMapperTests:82

Here is the runtime: PasteUs/PasteMeAdmin/runs/286045473