-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GETP-234 refactor: test fixture 모듈이 MemberId 클래스를 사용하도록 변경
- Loading branch information
Showing
4 changed files
with
12 additions
and
35 deletions.
There are no files selected for viewing
18 changes: 6 additions & 12 deletions
18
src/test/java/es/princip/getp/fixture/client/ClientFixture.java
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 |
---|---|---|
@@ -1,26 +1,20 @@ | ||
package es.princip.getp.fixture.client; | ||
|
||
import es.princip.getp.domain.client.model.Client; | ||
import es.princip.getp.domain.member.model.MemberId; | ||
|
||
import java.util.List; | ||
import java.util.stream.LongStream; | ||
|
||
import static es.princip.getp.fixture.client.AddressFixture.address; | ||
import static es.princip.getp.fixture.client.BankAccountFixture.bankAccount; | ||
import static es.princip.getp.fixture.common.EmailFixture.email; | ||
|
||
public class ClientFixture { | ||
|
||
public static Client client(final Long memberId) { | ||
public static Client client(final MemberId memberId) { | ||
return Client.builder() | ||
.memberId(memberId) | ||
.email(email()) | ||
.address(AddressFixture.address()) | ||
.bankAccount(BankAccountFixture.bankAccount()) | ||
.address(address()) | ||
.bankAccount(bankAccount()) | ||
.build(); | ||
} | ||
|
||
public static List<Client> clientList(final int size, final Long memberIdBias) { | ||
return LongStream.range(0, size) | ||
.mapToObj(i -> client(memberIdBias + i)) | ||
.toList(); | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
src/test/java/es/princip/getp/fixture/member/MemberFixture.java
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 |
---|---|---|
@@ -1,23 +1,13 @@ | ||
package es.princip.getp.fixture.member; | ||
|
||
import es.princip.getp.domain.common.model.Email; | ||
import es.princip.getp.domain.member.model.Member; | ||
import es.princip.getp.domain.member.model.MemberType; | ||
|
||
import java.util.List; | ||
import java.util.stream.IntStream; | ||
|
||
import static es.princip.getp.fixture.common.EmailFixture.email; | ||
|
||
public class MemberFixture { | ||
|
||
public static Member member(final MemberType memberType) { | ||
return Member.of(email(), PasswordFixture.password(), memberType); | ||
} | ||
|
||
public static List<Member> memberList(final int size, final int bias, final MemberType memberType) { | ||
return IntStream.range(bias, bias + size) | ||
.mapToObj(i -> Member.of(Email.from("test" + i + "@example.com"), PasswordFixture.password(), memberType)) | ||
.toList(); | ||
} | ||
} |
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
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