forked from Zakaria/RestAssured
28 lines
644 B
Java
28 lines
644 B
Java
package zacksolutions.DayEight;
|
|
|
|
import org.testng.ITestContext;
|
|
import org.testng.annotations.Test;
|
|
import static io.restassured.RestAssured.*;
|
|
|
|
/**
|
|
* DeleteUserTest
|
|
*/
|
|
public class DeleteUserTest {
|
|
@Test
|
|
void delete_User(ITestContext context) {
|
|
|
|
int id = (Integer) context.getSuite().getAttribute("user_id");
|
|
|
|
String bearerToken = "2fjksdc32opcmlpqweldien324fwefwnklploqpiwuioennxmhjgasdfe";
|
|
|
|
given()
|
|
.header("Authorization", "Bearer " + bearerToken)
|
|
.pathParam("id", id)
|
|
.when()
|
|
.delete("https://foobar.com/public/v2/users/{id}")
|
|
.then().statusCode(204)
|
|
.log().all();
|
|
}
|
|
|
|
}
|