Search in sources :

Example 1 with DefaultJackson2ObjectMapperFactory

use of io.restassured.mapper.factory.DefaultJackson2ObjectMapperFactory in project rest-assured by rest-assured.

the class MultiPartUploadITest method multiPartSupportsSpecifyingAnObjectMapperToMultiPartSpecBuilder.

@Test
public void multiPartSupportsSpecifyingAnObjectMapperToMultiPartSpecBuilder() throws Exception {
    // Given
    final Greeting greeting = new Greeting();
    greeting.setFirstName("John");
    greeting.setLastName("Doe");
    // When
    given().multiPart(new MultiPartSpecBuilder(greeting, new Jackson2Mapper(new DefaultJackson2ObjectMapperFactory())).fileName("RoleBasedAccessFeaturePlan.csv").controlName("text").mimeType("application/vnd.ms-excel").build()).when().post("/multipart/text").then().statusCode(200).body(containsString("John"), containsString("Doe"), containsString("{"));
}
Also used : Greeting(io.restassured.itest.java.objects.Greeting) MultiPartSpecBuilder(io.restassured.builder.MultiPartSpecBuilder) DefaultJackson2ObjectMapperFactory(io.restassured.mapper.factory.DefaultJackson2ObjectMapperFactory) Jackson2Mapper(io.restassured.internal.mapping.Jackson2Mapper) Test(org.junit.Test)

Aggregations

MultiPartSpecBuilder (io.restassured.builder.MultiPartSpecBuilder)1 Jackson2Mapper (io.restassured.internal.mapping.Jackson2Mapper)1 Greeting (io.restassured.itest.java.objects.Greeting)1 DefaultJackson2ObjectMapperFactory (io.restassured.mapper.factory.DefaultJackson2ObjectMapperFactory)1 Test (org.junit.Test)1