use of com.jayway.restassured.internal.mapping.Jackson2Mapper in project kylo by Teradata.
the class IntegrationTestBase method setupRestAssured.
@Before
public void setupRestAssured() throws URISyntaxException {
UserContext.setUser(UserContext.User.ADMIN);
RestAssured.baseURI = kyloConfig.getProtocol() + kyloConfig.getHost();
RestAssured.port = kyloConfig.getPort();
RestAssured.basePath = kyloConfig.getBasePath();
RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
Jackson2ObjectMapperFactory factory = (aClass, s) -> {
ObjectMapper om = new ObjectMapper();
om.registerModule(new JodaModule());
om.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true);
om.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
configureObjectMapper(om);
return om;
};
com.jayway.restassured.mapper.ObjectMapper objectMapper = new Jackson2Mapper(factory);
RestAssured.objectMapper(objectMapper);
startClean();
}
Aggregations