-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
51 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-49.7 KB
(8.5%)
web3-credential-server/build/test-results/test/binary/output.bin
Binary file not shown.
Binary file modified
BIN
+33 Bytes
(190%)
web3-credential-server/build/test-results/test/binary/output.bin.idx
Binary file not shown.
Binary file modified
BIN
-14.2 KB
(1.1%)
web3-credential-server/build/test-results/test/binary/results.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
web3-credential-server/build/tmp/compileTestJava/previous-compilation-data.bin
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ public class UnivCertApiTest { | |
void shouldSendCertificationCodeSuccessfully() { | ||
// JSON Request Payload | ||
String jsonRequest = "{\n" + | ||
" \"key\": \"0572d205-ba30-4260-beb7-87577c91e30a\",\n" + | ||
" \"key\": \"43086994-92b9-4caa-8b3e-be2510051c8e\",\n" + | ||
" \"email\": \"[email protected]\",\n" + | ||
" \"univName\": \"경북대학교\",\n" + | ||
" \"univ_check\": true\n" + | ||
|
@@ -150,4 +150,37 @@ void shouldClearCertifiedUserListSuccessfully() { | |
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); | ||
assertThat(response.getBody()).contains("\"success\":true"); | ||
} | ||
|
||
@Test | ||
@DisplayName("인증 요청할 대학명 전송에 성공해야 합니다.") | ||
void shouldSendUnivNameSuccessfully() { | ||
// JSON Request Payload | ||
String jsonRequest = """ | ||
{ | ||
"univName" : "경북대학교" | ||
} | ||
"""; | ||
|
||
// Set Headers | ||
HttpHeaders headers = new HttpHeaders(); | ||
headers.setContentType(MediaType.APPLICATION_JSON); | ||
|
||
// Create HttpEntity | ||
HttpEntity<String> request = new HttpEntity<>(jsonRequest, headers); | ||
|
||
// Send POST request to the /check endpoint | ||
ResponseEntity<String> response = restTemplate.exchange( | ||
"https://univcert.com/api/v1/check", | ||
HttpMethod.POST, | ||
request, | ||
String.class | ||
); | ||
|
||
// 로그에 응답 본문 출력 | ||
System.out.println("Response Body: " + response.getBody()); | ||
|
||
// Validate Response for success | ||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); | ||
assertThat(response.getBody()).contains("\"success\":true"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters