forked from Zakaria/RestAssured
day 8: Chaining and TestNG
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user