测试withObjectAlgorithm withArrayAlgorithm withPrimitiveAlgorithm withNullAlgorithm withOtherAlgorithm方法
()
| 94 | * 测试withObjectAlgorithm withArrayAlgorithm withPrimitiveAlgorithm withNullAlgorithm withOtherAlgorithm方法 |
| 95 | */ |
| 96 | @Test |
| 97 | public void diff6() { |
| 98 | String str1 = "{\"a\":null}"; |
| 99 | String str2 = "{\"a\":[1,2,3]}"; |
| 100 | JsonElement a = new JsonParser().parse(str1); |
| 101 | JsonElement b = new JsonParser().parse(str2); |
| 102 | List<String> specialPath = new ArrayList<>(); |
| 103 | List<Result> diff = new Diff().withNoisePahList(null).withSpecialPath(specialPath) |
| 104 | .withObjectComparator(new SimpleObjectComparator()).withArrayComparator(new SimilarArrayComparator()) |
| 105 | .withPrimitiveAlgorithm(new DefaultPrimitiveComparator()).withNullComparator(new DefaultNullComparator()) |
| 106 | .withOtheComparator(new DefaultOtherComparator()).diffElement(a, b); |
| 107 | assertEquals(ResultConvertUtil.TYPE_MODIFY, diff.get(0).getDiffType()); |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * 测试constrcutDefaultComparator方法 |
nothing calls this directly
no test coverage detected