Skip to content

Commit

Permalink
refactor: TopicFacadeTest 리펙토링
Browse files Browse the repository at this point in the history
- getTopicUpdateRequest 메서드 추출
  • Loading branch information
kimdozzi committed Jul 11, 2024
1 parent 52c4749 commit 60e7a69
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ private TopicCreateRequest getTopicCreateRequest() {
.build();
}

private TopicUpdateRequest getTopicUpdateRequest(String title, String description, String tags, int pointPerPersion,
String notice) {
return TopicUpdateRequest.builder()
.title(title)
.description(description)
.tags(tags)
.pointPerPerson(pointPerPersion)
.notice(notice).build();
}

@Nested
@DisplayName("토픽 생성 메서드는")
class Describe_topic_create {
Expand Down Expand Up @@ -93,12 +103,8 @@ public void it_returns_2XX_if_the_topic_is_modified() {
TopicCreateRequest topicCreateRequest = getTopicCreateRequest();
Long savedTopicId = topicFacade.create(topicCreateRequest);

TopicUpdateRequest topicUpdateRequest = TopicUpdateRequest.builder()
.title("1일 5커밋")
.description(topicA.getDescription())
.tags(topicA.getTags())
.pointPerPerson(topicA.getPointPerPerson())
.notice(topicA.getNotice()).build();
TopicUpdateRequest topicUpdateRequest = getTopicUpdateRequest("1일 1커밋", topicA.getDescription(),
topicA.getTags(), topicA.getPointPerPerson(), topicA.getNotice());

topicFacade.update(savedTopicId, topicUpdateRequest);

Expand Down

0 comments on commit 60e7a69

Please sign in to comment.