Search in sources :

Example 1 with ObjectMapperConfig

use of com.jayway.restassured.config.ObjectMapperConfig in project openlmis-stockmanagement by OpenLMIS.

the class BaseWebIntegrationTest method init.

/**
 * Method called to initialize basic resources after the object is created.
 */
@PostConstruct
public void init() {
    mockExternalAuthorization();
    RestAssured.baseURI = BASE_URL;
    RestAssured.port = serverPort;
    RestAssured.config = RestAssuredConfig.config().objectMapperConfig(new ObjectMapperConfig().jackson2ObjectMapperFactory((clazz, charset) -> objectMapper));
    RamlDefinition ramlDefinition = RamlLoaders.fromClasspath().load("api-definition-raml.yaml").ignoringXheaders();
    restAssured = ramlDefinition.createRestAssured();
}
Also used : ObjectMapperConfig(com.jayway.restassured.config.ObjectMapperConfig) RamlDefinition(guru.nidi.ramltester.RamlDefinition) PostConstruct(javax.annotation.PostConstruct)

Aggregations

ObjectMapperConfig (com.jayway.restassured.config.ObjectMapperConfig)1 RamlDefinition (guru.nidi.ramltester.RamlDefinition)1 PostConstruct (javax.annotation.PostConstruct)1