Skip to content

Commit

Permalink
Fix test. AS_PATH_LIST should return empty list not null.
Browse files Browse the repository at this point in the history
  • Loading branch information
kallestenflo committed Jan 30, 2022
1 parent 72fed27 commit 9674339
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -2,8 +2,12 @@

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;


Expand All @@ -26,6 +30,8 @@ public void testSuppressExceptionsIsRespectedPath() {
.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();
}
}

0 comments on commit 9674339

Please sign in to comment.