Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿš€ 2๋‹จ๊ณ„ - ๊นƒํ—™ ๋กœ๊ทธ์ธ ๊ตฌํ˜„ #613

Open
wants to merge 4 commits into
base: beyondorder
Choose a base branch
from

Conversation

beyondorder
Copy link

No description provided.

@hiblue02
Copy link

์„ํ˜„๋‹˜! ๋กœ๊ทธ์ธ ํ›„ ํšŒ์›์ •๋ณด๋ฅผ ์กฐํšŒํ•˜๋Š” ์ธ์ˆ˜ํ…Œ์ŠคํŠธ๊ฐ€ ๋ณด์ด์ง€ ์•Š๋„ค์š”. ๐Ÿ˜ญ
๊ทธ๋ฆฌ๊ณ  fake๊ฐ์ฒด๋ฅผ ํ™œ์šฉํ•œ ์ธ์ˆ˜ํ…Œ์ŠคํŠธ๋„ ๋ณด์ด์ง€ ์•Š๋Š”๋ฐ์š”. commit์ด ๋ช‡ ๊ฐœ ๋ˆ„๋ฝ๋œ๊ฑธ๊นŒ์š”?

์ˆ˜์ • ํ›„ ๋‹ค์‹œ ๋ฆฌ๋ทฐ ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!

Copy link

@hiblue02 hiblue02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ธ์ˆ˜ํ…Œ์ŠคํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค์— ๋ช‡๊ฐ€์ง€ ๋น ์ง„ ๋‚ด์šฉ์ด ์žˆ๋„ค์š”!
์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋‘์—ˆ์œผ๋‹ˆ, ํ™•์ธํ•ด์ฃผ์‹œ๊ณ , ๋‹ค์‹œ ๋ฆฌ๋ทฐ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿ˜„

Comment on lines +3 to +6
public enum GithubResponse {
์‚ฌ์šฉ์ž1("code1", "accessToken1","[email protected]"),
์‚ฌ์šฉ์ž2("code2", "accessToken2","[email protected]"),
์‚ฌ์šฉ์ž3("code3", "accessToken3","[email protected]");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fake ๊ฐ์ฒด๊ฐ€ main์— ์žˆ๋„ค์š”. ๐Ÿ˜…

@@ -9,7 +10,7 @@ public class GlobalExceptionHandler {

@ExceptionHandler(IllegalArgumentException.class)
public ResponseEntity<ErrorResponse> handleBadRequestException(IllegalArgumentException e) {
return ResponseEntity.badRequest().body(new ErrorResponse(e.getMessage()));
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(new ErrorResponse(e.getMessage()));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ๋ฐ˜์˜ ๐Ÿ’ฏ

Comment on lines +41 to +42
Station source = this.stationRepository.findById(request.getSource()).orElseThrow(() -> new RuntimeException("์กด์žฌํ•˜์ง€ ์•Š๋Š” ์ถœ๋ฐœ์—ญ์ž…๋‹ˆ๋‹ค."));
Station target = this.stationRepository.findById(request.getTarget()).orElseThrow(() -> new RuntimeException("์กด์žฌํ•˜์ง€ ์•Š๋Š” ๋„์ฐฉ์—ญ์ž…๋‹ˆ๋‹ค."));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exception์˜ ๋ฒ”์œ„๊ฐ€ ๋„“์–ด์กŒ๋„ค์š”. RuntimeException์œผ๋กœ ๋ฐ”๊พผ ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”? ๐Ÿค”

Comment on lines +13 to +16
@PostMapping("/github/access-token")
public ResponseEntity<GithubAccessTokenResponse> test(@RequestBody GithubAccessTokenRequest request) {
return ResponseEntity.ok(new GithubAccessTokenResponse(GithubResponse.findByCode(request.getCode()).getAccessToken()));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ธ์ˆ˜ํ…Œ์ŠคํŠธ์—์„œ fake(test/github/access-token)์„ ํ˜ธ์ถœํ•˜๋Š” ๋ถ€๋ถ„์ด ๋ณด์ด์ง€ ์•Š์•„์š”. ์ œ๊ฐ€ ๋ชป์ฐพ์€ ๊ฑธ๊นŒ์š”? ๐Ÿค”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants