io.qameta.allure.context.JacksonContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of allure-plugin-api Show documentation
Show all versions of allure-plugin-api Show documentation
Module allure-plugin-api of Allure Framework.
package io.qameta.allure.context;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.qameta.allure.Context;
/**
* Context that stores pre-configured jackson mapper.
*
* @since 2.0
*/
public class JacksonContext implements Context {
private final ObjectMapper mapper;
public JacksonContext() {
this.mapper = new ObjectMapper()
.enable(SerializationFeature.INDENT_OUTPUT)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
@Override
public ObjectMapper getValue() {
return mapper;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy