io.restassured.mapper.ObjectMapperType Java Examples

The following examples show how to use io.restassured.mapper.ObjectMapperType. 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: OrderResourceShould.java    From vlingo-examples with Mozilla Public License 2.0 6 votes vote down vote up
private String createOrderWithSingleItem() {

        OrderResource.OrderCreateRequest request = OrderResource.OrderCreateRequest.Builder
                .create()
                .withProduct(new ProductId("pid1"), 100)
                .withUser(new UserId(1))
                .build();

        Response response =
                baseGiven()
                        .when()
                        .body(request, ObjectMapperType.GSON)
                        .post("/order")
                        .then()
                        .assertThat()
                        .statusCode(HttpStatus.SC_CREATED)
                        .header("Location", matchesPattern("/order/(\\d+)"))
                        .extract()
                        .response();
        return response.header("Location");
    }
 
Example #2
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 #3
Source File: RestApiActions.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Sends PUT request to specified resource.
 *
 * @param resourceId Id of resource
 * @param object     Body of request
 */
public ApiResponse update( String resourceId, Object object )
{
    Response response =
        this.given().body( object, ObjectMapperType.GSON )
            .when()
            .put( resourceId );

    return new ApiResponse( response );
}
 
Example #4
Source File: TestUtil.java    From cap-community with MIT License 4 votes vote down vote up
public static ObjectMapperType objectMapperType() {
    return ObjectMapperType.JACKSON_2;
}
 
Example #5
Source File: TestUtil.java    From cloud-s4-sdk-book with Apache License 2.0 4 votes vote down vote up
public static ObjectMapperType objectMapperType()
{
    return ObjectMapperType.JACKSON_2;
}
 
Example #6
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));
}
 
Example #7
Source File: TestUtil.java    From cloud-s4-sdk-examples with Apache License 2.0 4 votes vote down vote up
public static ObjectMapperType objectMapperType()
{
    return ObjectMapperType.JACKSON_2;
}
 
Example #8
Source File: ITBase.java    From fess with Apache License 2.0 4 votes vote down vote up
protected static RequestSpecification checkMethodBase(final Map<String, Object> body) {
    return given().contentType("application/json").header("Authorization", getTestToken()).body(body, ObjectMapperType.JACKSON_2)
            .when();
}