Summary Table
Categories |
Total Count |
PII |
0 |
URL |
1 |
DNS |
1 |
EKL |
0 |
IP |
0 |
PORT |
1 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
package webAPI;
import static io.restassured.RestAssured.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import io.restassured.path.json.JsonPath;
public class token {
protected static String OAT_TOKEN = "";
protected static String baseURI = "http://
DNS.URL:PORT
/";
@Before
public void getAccessToken() {
JsonPath token = given()
// .log()
// .all()
.auth()
.preemptive()
.basic("ARS_FRONTEND_APP", "ars123456")
.queryParam("grant_type", "password")
.queryParam("username", "ars")
.queryParam("password", "ars")
.formParam("grant_type", "password")
.when()
.post(baseURI +"ars/oauth/token")
.andReturn()
.jsonPath();
OAT_TOKEN = token.getString("access_token");
}
}