io.restassured.config.ObjectMapperConfig Java Examples

The following examples show how to use io.restassured.config.ObjectMapperConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PersonResourceTest.java    From quarkus-quickstarts with Apache License 2.0 5 votes vote down vote up
@BeforeAll
static void initAll() {
    RestAssured.defaultParser = Parser.JSON;
    RestAssured.config
            .logConfig((logConfig().enableLoggingOfRequestAndResponseIfValidationFails()))
            .objectMapperConfig(new ObjectMapperConfig().jackson2ObjectMapperFactory((type, s) -> new ObjectMapper()
                    .registerModule(new Jdk8Module())
                    .registerModule(new JavaTimeModule())
                    .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)));
}
 
Example #2
Source File: IntegrationTest.java    From prebid-server-java with Apache License 2.0 5 votes vote down vote up
static RequestSpecification spec(int port) {
    return new RequestSpecBuilder()
            .setBaseUri("http://localhost")
            .setPort(port)
            .setConfig(RestAssuredConfig.config()
                    .objectMapperConfig(new ObjectMapperConfig(new Jackson2Mapper((aClass, s) -> mapper))))
            .build();
}
 
Example #3
Source File: JLineupWebApplicationTests.java    From jlineup with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() {
    RestAssured.port = port;
    RestAssured.config = RestAssuredConfig.config().objectMapperConfig(new ObjectMapperConfig().jackson2ObjectMapperFactory(
            (cls, charset) -> objectMapper
    ));
}
 
Example #4
Source File: RestApiActions.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected RequestSpecification given()
{
    return RestAssured.given()
        .baseUri( this.baseUri )
        .basePath( endpoint )
        .config( RestAssured.config()
            .objectMapperConfig( new ObjectMapperConfig( ObjectMapperType.GSON ) ) );
}
 
Example #5
Source File: HibernateTenancyFunctionalityTest.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@BeforeAll
public static void beforeClass() {
    config = RestAssured.config().objectMapperConfig(new ObjectMapperConfig(ObjectMapperType.JSONB));
}