ru.integrations.check.condition.BodyJsonCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CheckingLib Show documentation
Show all versions of CheckingLib Show documentation
This library for help checking response.
package ru.integrations.check.condition;
import io.restassured.response.Response;
import lombok.RequiredArgsConstructor;
import org.hamcrest.Matcher;
/**
* Класс для извлечения значения по JsonPath.
*/
@RequiredArgsConstructor
public class BodyJsonCondition implements Condition {
private final String jsonPath;
private final Matcher matcher;
/**
* Метод излвечения данных из ответа по jsonPath.
*
* @param response Запрос.
*/
@Override
public void check(Response response) {
response.then()
.body(jsonPath, matcher);
}
}