11package com .deblock .jsondiff .matcher ;
22
33import com .deblock .jsondiff .diff .*;
4- import com . fasterxml .jackson .databind .JsonNode ;
5- import com . fasterxml .jackson .databind .node .ArrayNode ;
6- import com . fasterxml .jackson .databind .node .ObjectNode ;
7- import com . fasterxml .jackson .databind .node .ValueNode ;
4+ import tools .jackson .databind .JsonNode ;
5+ import tools .jackson .databind .node .ArrayNode ;
6+ import tools .jackson .databind .node .ObjectNode ;
7+ import tools .jackson .databind .node .ValueNode ;
88
99public class CompositeJsonMatcher implements JsonMatcher {
1010 private final PartialJsonMatcher <ArrayNode > jsonArrayPartialMatcher ;
@@ -23,12 +23,12 @@ public CompositeJsonMatcher(
2323
2424 @ Override
2525 public JsonDiff diff (Path path , JsonNode expected , JsonNode received ) {
26- if (expected instanceof ObjectNode && received instanceof ObjectNode ) {
27- return this .jsonObjectPartialMatcher .jsonDiff (path , ( ObjectNode ) expected , ( ObjectNode ) received , this );
28- } else if (expected instanceof ArrayNode && received instanceof ArrayNode ) {
29- return this .jsonArrayPartialMatcher .jsonDiff (path , ( ArrayNode ) expected , ( ArrayNode ) received , this );
30- } else if (expected instanceof ValueNode && received instanceof ValueNode ){
31- return this .primitivePartialMatcher .jsonDiff (path , ( ValueNode ) expected , ( ValueNode ) received , this );
26+ if (expected instanceof ObjectNode expectedObjectNode && received instanceof ObjectNode receivedObjectNode ) {
27+ return this .jsonObjectPartialMatcher .jsonDiff (path , expectedObjectNode , receivedObjectNode , this );
28+ } else if (expected instanceof ArrayNode expectedArrayNode && received instanceof ArrayNode receivedArrayNode ) {
29+ return this .jsonArrayPartialMatcher .jsonDiff (path , expectedArrayNode , receivedArrayNode , this );
30+ } else if (expected instanceof ValueNode expectedValueNode && received instanceof ValueNode receivedValueNode ){
31+ return this .primitivePartialMatcher .jsonDiff (path , expectedValueNode , receivedValueNode , this );
3232 } else {
3333 return new UnMatchedPrimaryDiff (path , expected , received );
3434 }
0 commit comments