enter image description here enter image description here我在邮递员中手动获得200状态代码,但是在自动化过程中却出现400错误。错误在哪里?
@Test
public void getTokenBeforeTest() {
Response resp = RestAssured.with().auth().preemptive().basic("asddannodsfdsnims", "password")
.contentType("multipart/form-data").and().header("grant_type", "client_credentials").and()
.header("Authorization", "Basic ZGFubm9uaW1zOnBhc3N3b3Jk")
.post("http://test.api......com/uaa/oauth/token");
int code = resp.getStatusCode();
String response = resp.asString();
System.out.println(code);
System.out.println(response);
Assert.assertEquals(code, "200");