Skip to content

Commit

Permalink
style: BugMapper 메서드 네이밍 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kmebin committed Nov 1, 2023
1 parent 48f49d2 commit 3c90fa8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/moabam/api/application/BugService.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class BugService {

public BugResponse getBug(Long memberId) {
Member member = memberService.getById(memberId);
return BugMapper.from(member.getBug());
return BugMapper.toBugResponse(member.getBug());
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/moabam/api/dto/BugMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public final class BugMapper {

public static BugResponse from(Bug bug) {
public static BugResponse toBugResponse(Bug bug) {
return BugResponse.builder()
.morningBug(bug.getMorningBug())
.nightBug(bug.getNightBug())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.moabam.api.application.BugService;
import com.moabam.api.dto.BugMapper;
import com.moabam.api.dto.BugResponse;
import com.moabam.fixture.BugFixture;

Expand All @@ -38,7 +39,7 @@ class BugControllerTest {
void get_bug_success() throws Exception {
// given
Long memberId = 1L;
BugResponse expected = BugFixture.bugResponse();
BugResponse expected = BugMapper.toBugResponse(BugFixture.bug());
given(bugService.getBug(memberId)).willReturn(expected);

// when & then
Expand Down
6 changes: 0 additions & 6 deletions src/test/java/com/moabam/fixture/BugFixture.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.moabam.fixture;

import com.moabam.api.domain.entity.Bug;
import com.moabam.api.dto.BugMapper;
import com.moabam.api.dto.BugResponse;

public final class BugFixture {

Expand All @@ -17,8 +15,4 @@ public static Bug bug() {
.goldenBug(GOLDEN_BUG)
.build();
}

public static BugResponse bugResponse() {
return BugMapper.from(bug());
}
}

0 comments on commit 3c90fa8

Please sign in to comment.