parameter test 추가
This commit is contained in:
@@ -54,14 +54,16 @@ class OAuth2BearerAuthTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: Bearer 토큰으로 인증 API 호출
|
// Step 2: Bearer 토큰으로 인증 API 호출
|
||||||
String apiUrl = TestConfig.getBaseUrl("/api/auth/case009?transactionId=1234567890");
|
String apiUrl = TestConfig.getBaseUrl("/api/auth/case009?transactionId=1234567890¶meterTest1=parameterTestValue1¶meterTest2=parameterTestValue2");
|
||||||
|
|
||||||
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
||||||
HttpPost httpPost = new HttpPost(apiUrl);
|
HttpPost httpPost = new HttpPost(apiUrl);
|
||||||
httpPost.setHeader("Authorization", "Bearer " + accessToken);
|
httpPost.setHeader("Authorization", "Bearer " + accessToken);
|
||||||
httpPost.setHeader("Content-Type", "application/json");
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
httpPost.setEntity(new StringEntity("{}", ContentType.APPLICATION_JSON));
|
httpPost.setEntity(new StringEntity("{}", ContentType.APPLICATION_JSON));
|
||||||
|
|
||||||
|
|
||||||
String responseBody = httpClient.execute(httpPost, response -> {
|
String responseBody = httpClient.execute(httpPost, response -> {
|
||||||
String body = EntityUtils.toString(response.getEntity());
|
String body = EntityUtils.toString(response.getEntity());
|
||||||
System.out.println("Response Body: " + body);
|
System.out.println("Response Body: " + body);
|
||||||
|
|||||||
Reference in New Issue
Block a user