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

๐Ÿš€ 3๋‹จ๊ณ„ - ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ #968

Open
wants to merge 10 commits into
base: nice7677
Choose a base branch
from

Conversation

nice7677
Copy link

์•ˆ๋…•ํ•˜์„ธ์š”.
JPA๋ฅผ ์•ˆ ์“ด์ง€ ์ข€ ๋ผ์„œ ๋งŽ์ด ๊นŒ๋จน์–ด์„œ ๋งคํ•‘ ๋ถ€๋ถ„์—์„œ ์ฝ”๋“œ๊ฐ€ ์ข€ ๋”๋Ÿฝ์Šต๋‹ˆ๋‹ค.

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.

3๋‹จ๊ณ„ ๋ฏธ์…˜๋„ ์ž˜ ๊ตฌํ˜„ํ•ด์ฃผ์…จ๋„ค์š”.
Line๊ณผ Section, Station, Stations๊ฐ„์˜ ๊ด€๊ณ„์— ๋Œ€ํ•ด ๋‹ค์‹œ ํ•œ๋ฒˆ ๊ณ ๋ฏผํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”. ๐Ÿ˜…
์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒผ์œผ๋‹ˆ ํ™•์ธํ•ด์ฃผ์‹œ๊ณ , ๋‹ค์‹œ ๋ฆฌ๋ทฐ ์š”์ฒญ์ฃผ์„ธ์š”!

README.md Outdated
Comment on lines 26 to 29
- [ ] ์ง€ํ•˜์ฒ  ๋…ธ์„ ์— ๊ตฌ๊ฐ„์„ ๋“ฑ๋ก
- [ ] ์ƒˆ๋กœ์šด ๊ตฌ๊ฐ„์˜ ์ƒํ–‰์—ญ์€ ํ•ด๋‹น ๋…ธ์„ ์— ๋“ฑ๋ก๋˜์–ด์žˆ๋Š” ํ•˜ํ–‰ ์ข…์ ์—ญ์ด์–ด์•ผ ํ•œ๋‹ค.
- [ ] ์ƒˆ๋กœ์šด ๊ตฌ๊ฐ„์˜ ํ•˜ํ–‰์—ญ์€ ํ•ด๋‹น ๋…ธ์„ ์— ๋“ฑ๋ก๋˜์–ด์žˆ๋Š” ์—ญ์ผ ์ˆ˜ ์—†๋‹ค.
- [ ] ์ƒˆ๋กœ์šด ๊ตฌ๊ฐ„ ๋“ฑ๋ก์‹œ ์œ„ ์กฐ๊ฑด์— ๋ถ€ํ•ฉํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์—๋Ÿฌ ์ฒ˜๋ฆฌํ•œ๋‹ค.

Choose a reason for hiding this comment

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

๊ตฌํ˜„ํ•œ ์‚ฌํ•ญ์€ ์ฒดํฌ ํ‘œ์‹œํ•ด์ฃผ์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.

Comment on lines +18 to +21
@ManyToOne
@JoinColumn(name = "station_id", nullable = false)
private Station station;

Choose a reason for hiding this comment

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

Station์ด ์•„๋‹ˆ๋ผ Stations๊ฐ€ ๋“ค์–ด๊ฐ€์•ผ ํ•˜์ง€ ์•Š์„๊นŒ์š”? ๐Ÿค” Stations์™€ Section์˜ ์—ฐ๊ฒฐ๊ณ ๋ฆฌ๊ฐ€ ์—†์–ด๋ณด์—ฌ์š”.
๊ทธ๋ฆฌ๊ณ  line์—์„œ section์„ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์•ผ ํ• ๊นŒ์š”? stations์„ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์•ผ ํ• ๊นŒ์š”? ์š” ๋ถ€๋ถ„์— ๋Œ€ํ•ด ๊ณ ๋ฏผํ•ด๋ด์ฃผ์„ธ์š”!

Copy link
Author

Choose a reason for hiding this comment

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

์ƒ๊ฐ๋ชปํ–ˆ๋„ค์š” ๊ทธ๋ ‡๊ฒŒํ•˜๋ฉด ํ•ด๊ฒฐ๋˜๋Š” ๋ฌธ์ œ์˜€๋Š”๋ฐ ๋Œ๊ณ ๋Œ์•„์„œ ๋งŒ๋“ค์—ˆ๋„ค์š”๐Ÿ˜…

Comment on lines +24 to 26
public static LineResponse of(Line route) {
return new LineResponse(route);
}

Choose a reason for hiding this comment

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

์ •์  ํŒฉํ† ๋ฆฌ ๋ฉ”์†Œ๋“œ ์‚ฌ์šฉ ๐Ÿ‘

Comment on lines 71 to 104
Map<String, String> params = new HashMap<>();
params.put("upStationId", "1");
params.put("downStationId", "2");
params.put("distance", "10");

Long lineId = 1L;

ExtractableResponse<Response> createSectionResponse = RestAssuredUtils.create(new RestAssuredCondition(String.format(LINE_SECTION_API_URI, lineId), params));
assertThat(createSectionResponse.statusCode()).isEqualTo(500);


Map<String, String> stationParams = new HashMap<>();
stationParams.put("name", "์„์ง€๋กœ์—ญ");
RestAssuredUtils.create(new RestAssuredCondition(STATION_API_URI, stationParams));


params.put("upStationId", "2");
params.put("downStationId", "3");
params.put("distance", "10");
createSectionResponse = RestAssuredUtils.create(new RestAssuredCondition(String.format(LINE_SECTION_API_URI, lineId), params));
assertThat(createSectionResponse.statusCode()).isEqualTo(201);

ExtractableResponse<Response> deleteSectionResponse = RestAssuredUtils.delete(new RestAssuredCondition(String.format(LINE_SECTION_API_URI + "?stationId=%s", lineId, 3)));
assertThat(deleteSectionResponse.statusCode()).isEqualTo(204);

ExtractableResponse<Response> getSectionResponse = RestAssuredUtils.inquiry(new RestAssuredCondition(String.format(LINE_SECTION_API_URI, lineId)));

assertThat(getSectionResponse.statusCode()).isEqualTo(200);

List<SectionResponse> sectionResponses = getSectionResponse.body().jsonPath().getList(".", SectionResponse.class);

assertThat(sectionResponses.size()).isEqualTo(2);
assertThat(sectionResponses.get(0).getStationId()).isEqualTo(1L);
assertThat(sectionResponses.get(1).getStationId()).isEqualTo(2L);

Choose a reason for hiding this comment

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

์ธ์ˆ˜ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๊ฐ€ ๊ธธ๊ณ  ํ…Œ์ŠคํŠธ ์ค‘๊ฐ„์ค‘๊ฐ„ assertThat์ด ๋“ค์–ด๊ฐ€ ์žˆ์–ด์„œ ํ•œ๋ˆˆ์— ์•ˆ๋“ค์–ด์˜ค๋Š” ๊ฒƒ ๊ฐ™์•„์š”. ๐Ÿ˜… given, when, then ์ฃผ์„์œผ๋กœ ๊ตฌ๋ถ„ํ•ด์ฃผ๋ฉด ์–ด๋–จ๊นŒ์š”? ํ…Œ์ŠคํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค๋„ ๊ฐ™์ด ์žˆ์œผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.

Comment on lines 143 to 149
return sectionService.getSections(line)
.stream()
.sorted(Comparator.comparing(Section::getId))
.map(section -> {
return SectionResponse.of(section);
})
.collect(Collectors.toList());

Choose a reason for hiding this comment

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

id ์ˆœ์„œ๋กœ sortingํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”? id๋ฅผ ์ˆœ์„œ ์นผ๋Ÿผ์œผ๋กœ ์‚ฌ์šฉํ•ด๋„ ๊ดœ์ฐฎ์„๊นŒ์š”? ๐Ÿค”

Comment on lines 118 to 120
private void validateSection(List<Section> sections, Section section) {

}

Choose a reason for hiding this comment

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

์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ฝ”๋“œ๋Š” ์ง€์›Œ์ฃผ์„ธ์š”.

Comment on lines +67 to +69
@DisplayName("๊ตฌ๊ฐ„ ์ œ๊ฑฐ ๊ธฐ๋Šฅ")
@Test
void deleteSection() {

Choose a reason for hiding this comment

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

๊ตฌ๊ฐ„ ์ œ๊ฑฐ ์˜ˆ์™ธ ์ผ€์ด์Šค์— ๋Œ€ํ•œ ๊ฒ€์ฆ์ด ์—†์–ด์š”. ๐Ÿ˜ญ

๊ตฌ๊ฐ„ ๊ด€๋ฆฌ ๊ธฐ๋Šฅ์˜ ์˜ˆ์™ธ ์ผ€์ด์Šค๋ฅผ ๊ณ ๋ คํ•˜๊ธฐ

-๊ตฌ๊ฐ„ ๋“ฑ๋ก๊ณผ ์ œ๊ฑฐ ๊ธฐ๋Šฅ์˜ ์˜ˆ์™ธ์ผ€์ด์Šค๋“ค์— ๋Œ€ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค๋ฅผ ์ •์˜

-์ธ์ˆ˜ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์ด๋ฅผ ๋งŒ์กฑ์‹œํ‚ค๋Š” ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„

Comment on lines +38 to +40
@DisplayName("๊ตฌ๊ฐ„ ๋“ฑ๋ก ๊ธฐ๋Šฅ")
@Test
void createSection() {

Choose a reason for hiding this comment

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

๊ตฌ๊ฐ„ ๋“ฑ๋ก ์˜ˆ์™ธ ์ผ€์ด์Šค์— ๋Œ€ํ•œ ๊ฒ€์ฆ์ด ์—†์–ด์š”. ๐Ÿ˜ญ

๊ตฌ๊ฐ„ ๊ด€๋ฆฌ ๊ธฐ๋Šฅ์˜ ์˜ˆ์™ธ ์ผ€์ด์Šค๋ฅผ ๊ณ ๋ คํ•˜๊ธฐ

-๊ตฌ๊ฐ„ ๋“ฑ๋ก๊ณผ ์ œ๊ฑฐ ๊ธฐ๋Šฅ์˜ ์˜ˆ์™ธ์ผ€์ด์Šค๋“ค์— ๋Œ€ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค๋ฅผ ์ •์˜

-์ธ์ˆ˜ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ์ด๋ฅผ ๋งŒ์กฑ์‹œํ‚ค๋Š” ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„

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