Change to status code 422
This commit is contained in:
parent
623097245c
commit
fe1f2c703f
@ -5,9 +5,6 @@ import model.Status;
|
|||||||
import model.Ticket;
|
import model.Ticket;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static io.restassured.RestAssured.given;
|
import static io.restassured.RestAssured.given;
|
||||||
|
|
||||||
/** Обновление тикета */
|
/** Обновление тикета */
|
||||||
@ -23,19 +20,15 @@ public class UpdateTicketTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateTicketNegative(Ticket ticket) {
|
private void updateTicketNegative(Ticket ticket) {
|
||||||
int id = ticket.getId();
|
AuthToken authToken = login();
|
||||||
|
|
||||||
Map<String, Object> body = new HashMap<>();
|
|
||||||
body.put("comment", "Изменение статуса");
|
|
||||||
body.put("new_status", "");//Status.OPEN возвращает 201
|
|
||||||
|
|
||||||
given()
|
given()
|
||||||
.pathParam("ticketId", id)
|
.header("Authorization", "Token " + authToken.getToken())
|
||||||
.body(body)
|
.pathParam("ticketId", ticket.getId())
|
||||||
|
.body(ticket)
|
||||||
.when()
|
.when()
|
||||||
.put("/api/tickets/{ticketId}/followup")
|
.put("/api/tickets/{ticketId}")
|
||||||
.then()
|
.then()
|
||||||
.statusCode(400)
|
.statusCode(422);
|
||||||
.extract().as(Ticket.class);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user