/
drutberg
/
test7261
Обзор
Документация
Войти
/
drutberg
/
test7261
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/java/config/ApiCourier.java
41 строка
1 KB
a.kryukova
Fix with README
22 окт 2023, 12:06
22 окт 2023, 12:06
8883a0e
Код
Авторство
О чём код?
package config; import courier.Courier; import courier.CourierLogin; import io.qameta.allure.Step; import io.restassured.response.ValidatableResponse; import static io.restassured.RestAssured.given; public class ApiCourier extends App { private static final String PATH = URL + "api/v1/courier/"; private static final String LOGIN_PATH = URL + "api/v1/courier/login"; @Step("Создание нового курьера") public ValidatableResponse create(Courier courier) { return given().log().all() .spec(getHeader()) .body(courier) .when() .post(PATH) .then().log().all(); } @Step("Авторизация курьера") public ValidatableResponse login(CourierLogin courierLogin) { return given().log().all() .spec(getHeader()) .body(courierLogin) .when() .post(LOGIN_PATH) .then().log().all(); } @Step("Удаление созданного курьера") public void delete(int id) { given().log().all() .spec(getHeader()) .when() .delete(PATH + id) .then().log().all(); } }