All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.integrations.check.condition.BodyJsonCondition Maven / Gradle / Ivy

The newest version!
package ru.integrations.check.condition;

import io.restassured.response.Response;
import lombok.RequiredArgsConstructor;
import org.hamcrest.Matcher;

/**
 * Class for execute with JsonPath.
 */
@RequiredArgsConstructor
public class BodyJsonCondition implements Condition {
    private final String jsonPath;
    @SuppressWarnings("rawtypes")
    private final Matcher matcher;

    /**
     * Get value in htmlPath.
     *
     * @param response Response.
     */
    @Override
    public void check(Response response) {
        response.then()
                .body(jsonPath, matcher);
    }

    @Override
    public String toString() {
        return "BodyJsonCondition{" +
                "jsonPath='" + jsonPath + '\'' +
                ", matcher=" + matcher +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy