Browse Source

Fix test. AS_PATH_LIST should return empty list not null.

heroku
Kalle Stenflo 3 years ago
parent
commit
9674339436
  1. 8
      json-path/src/test/java/com/jayway/jsonpath/TestSuppressExceptions.java

8
json-path/src/test/java/com/jayway/jsonpath/TestSuppressExceptions.java

@ -2,8 +2,12 @@ package com.jayway.jsonpath;
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNull;
@ -26,6 +30,8 @@ public class TestSuppressExceptions {
.mappingProvider(new JacksonMappingProvider()).options(Option.SUPPRESS_EXCEPTIONS, Option.AS_PATH_LIST)
.build());
String json = "{}";
assertNull(parseContext.parse(json).read(JsonPath.compile("$.missing")));
List<String> result = parseContext.parse(json).read(JsonPath.compile("$.missing"));
assertThat(result).isEmpty();
}
}

Loading…
Cancel
Save