package com.jayway.jsonpath;

import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
import org.junit.Test;

import static org.junit.Assert.assertNull;


public class TestSuppressExceptions {

  @Test
  public void testSuppressExceptionsIsRespected() {
    ParseContext parseContext = JsonPath.using(
        new Configuration.ConfigurationBuilder().jsonProvider(new JacksonJsonProvider())
            .mappingProvider(new JacksonMappingProvider()).options(Option.SUPPRESS_EXCEPTIONS)
            .build());
    String json = "{}";
    assertNull(parseContext.parse(json).read(JsonPath.compile("$.missing")));
  }

  @Test
  public void testSuppressExceptionsIsRespectedPath() {
    ParseContext parseContext = JsonPath.using(
        new Configuration.ConfigurationBuilder().jsonProvider(new JacksonJsonProvider())
            .mappingProvider(new JacksonMappingProvider()).options(Option.SUPPRESS_EXCEPTIONS, Option.AS_PATH_LIST)
            .build());
    String json = "{}";
    assertNull(parseContext.parse(json).read(JsonPath.compile("$.missing")));
  }
}

@@ -157,20 +157,142 @@
 org.
-junit.Test;%0A
+assertj.core.api.Assertions;%0Aimport org.junit.Test;%0A%0Aimport java.util.List;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;
 %0Aimp
@@ -1154,39 +1154,51 @@
 son = %22%7B%7D%22;%0A
+%0A
     
-assertNull(
+List%3CString%3E result = 
 parseContext
@@ -1241,21 +1241,54 @@
 $.missing%22))
+;%0A    assertThat(result).isEmpty(
 );%0A  %7D%0A%7D%0A

Fix test. AS_PATH_LIST should return empty list not null.