Search in sources :

Example 1 with JsonProcessingException

use of io.cucumber.messages.internal.com.fasterxml.jackson.core.JsonProcessingException in project cucumber-jvm by cucumber.

the class CompatibilityTest method readAllMessages.

private static List<JsonNode> readAllMessages(Path output) throws IOException {
    List<JsonNode> expectedEnvelopes = new ArrayList<>();
    ObjectMapper mapper = new ObjectMapper().enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING).configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    Files.readAllLines(output).forEach(s -> {
        try {
            expectedEnvelopes.add(mapper.readTree(s));
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    });
    return expectedEnvelopes;
}
Also used : ArrayList(java.util.ArrayList) JsonNode(io.cucumber.messages.internal.com.fasterxml.jackson.databind.JsonNode) JsonProcessingException(io.cucumber.messages.internal.com.fasterxml.jackson.core.JsonProcessingException) ObjectMapper(io.cucumber.messages.internal.com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

JsonProcessingException (io.cucumber.messages.internal.com.fasterxml.jackson.core.JsonProcessingException)1 JsonNode (io.cucumber.messages.internal.com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (io.cucumber.messages.internal.com.fasterxml.jackson.databind.ObjectMapper)1 ArrayList (java.util.ArrayList)1