diff --git a/Server/src/main/java/com/server/domain/account/domain/Account.java b/Server/src/main/java/com/server/domain/account/domain/Account.java index 0798bf71..b88bb06f 100644 --- a/Server/src/main/java/com/server/domain/account/domain/Account.java +++ b/Server/src/main/java/com/server/domain/account/domain/Account.java @@ -21,15 +21,16 @@ public class Account extends BaseEntity { private String account; - private String bank; + @Enumerated(EnumType.STRING) + private Bank bank; - private Account(String name, String account, String bank) { + private Account(String name, String account, Bank bank) { this.name = name; this.account = account; this.bank = bank; } - public static Account createAccount(String name, String accountNumber, String bank, Member member) { + public static Account createAccount(String name, String accountNumber, Bank bank, Member member) { Account account = new Account(name, accountNumber, bank); member.updateAccount(account); @@ -37,7 +38,7 @@ public static Account createAccount(String name, String accountNumber, String ba return account; } - public void updateAccount(String name, String account, String bank) { + public void updateAccount(String name, String account, Bank bank) { this.name = name; this.account = account; this.bank = bank; diff --git a/Server/src/main/java/com/server/domain/account/domain/Bank.java b/Server/src/main/java/com/server/domain/account/domain/Bank.java new file mode 100644 index 00000000..bdf4e43f --- /dev/null +++ b/Server/src/main/java/com/server/domain/account/domain/Bank.java @@ -0,0 +1,149 @@ +package com.server.domain.account.domain; + +import com.server.global.entity.BaseEnum; +import lombok.RequiredArgsConstructor; + +import java.util.function.Function; + +@RequiredArgsConstructor +public enum Bank implements BaseEnum { + KB("KB 국민은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 3) { + return checkLen(chunk[0], 6) && checkLen(chunk[1], 2) && checkLen(chunk[2], 6); + }else if(chunk.length == 4) { + return checkLen(chunk[0], 3) && + checkLen(chunk[1], 2) && + checkLen(chunk[2], 4) && + checkLen(chunk[3], 3); + } + return false; + }), + IBK("IBK 기업은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 4) { + return checkLen(chunk[0], 3) && + checkLen(chunk[1], 6) && + checkLen(chunk[2], 2) && + checkLen(chunk[3], 3); + } + return false; + }), + NH("농협은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 4) { + return checkLen(chunk[0], 3) && + checkLen(chunk[1], 4) && + checkLen(chunk[2], 4) && + checkLen(chunk[3], 2); + } + return false; + }), + SH("신한은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 3) { + return (checkLen(chunk[0], 3) && + checkLen(chunk[1], 2) && + checkLen(chunk[2], 6)) || + (checkLen(chunk[0], 3) && + checkLen(chunk[1], 3) && + checkLen(chunk[2], 6)); + } + return false; + }), + WR("우리은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if (chunk.length == 3) { + return checkLen(chunk[0], 4) && checkLen(chunk[1], 3) && checkLen(chunk[2], 6); + } + return false; + }), + HN("KEB 하나은행(구 외환은행)", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 3) { + return (checkLen(chunk[0], 3) && + checkLen(chunk[1], 6) && + checkLen(chunk[2], 5)) || + (checkLen(chunk[0], 3) && + checkLen(chunk[1], 6) && + checkLen(chunk[2], 3)); + } + return false; + }), + CITY("씨티은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if (chunk.length == 3) { + return checkLen(chunk[0], 3) && checkLen(chunk[1], 6) && checkLen(chunk[2], 3); + } + return false; + }), + DGB("DGB 대구은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 4) { + return checkLen(chunk[0], 3) && + checkLen(chunk[1], 2) && + checkLen(chunk[2], 6) && + checkLen(chunk[3], 1); + } + return false; + }), + BNK("BNK 부산은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if(chunk.length == 4) { + return checkLen(chunk[0], 3) && + checkLen(chunk[1], 4) && + checkLen(chunk[2], 4) && + checkLen(chunk[3], 2); + } + return false; + }), + SC("SC 제일은행", (attribute) -> { + String[] chunk = attribute.split("-"); + if (chunk.length == 3) { + return checkLen(chunk[0], 3) && checkLen(chunk[1], 2) && checkLen(chunk[2], 6); + } + return false; + }), + KBANK("케이뱅크", (attribute) -> { + String[] chunk = attribute.split("-"); + if (chunk.length == 3) { + return checkLen(chunk[0], 3) && checkLen(chunk[1], 3) && checkLen(chunk[2], 6); + } + return false; + }), + KAKAO("카카오뱅크", (attribute) -> { + String[] chunk = attribute.split("-"); + if (chunk.length == 3) { + return checkLen(chunk[0], 4) && checkLen(chunk[1], 2) && checkLen(chunk[2], 7); + } + return false; + }) + ; + + private final String description; + + private final Function checkAccount; + + public boolean checkAccount(String account) { + return this.checkAccount.apply(account); + } + + @Override + public String getName() { + return name(); + } + + @Override + public String getDescription() { + return this.description; + } + + private static boolean checkLen(String chunk, int len) { + try { + Long.parseLong(chunk); + return chunk.length() == len; + } catch (NumberFormatException e) { + return false; + } + } +} diff --git a/Server/src/main/java/com/server/domain/adjustment/controller/dto/request/AccountUpdateApiRequest.java b/Server/src/main/java/com/server/domain/adjustment/controller/dto/request/AccountUpdateApiRequest.java index f1b78ab2..11f6b9a9 100644 --- a/Server/src/main/java/com/server/domain/adjustment/controller/dto/request/AccountUpdateApiRequest.java +++ b/Server/src/main/java/com/server/domain/adjustment/controller/dto/request/AccountUpdateApiRequest.java @@ -1,5 +1,6 @@ package com.server.domain.adjustment.controller.dto.request; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.service.dto.request.AccountUpdateServiceRequest; import lombok.AllArgsConstructor; import lombok.Builder; @@ -7,6 +8,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; @AllArgsConstructor @Getter @@ -14,11 +16,13 @@ public class AccountUpdateApiRequest { @NotBlank(message = "{validation.account.name.notBlank}") + @Size(min = 2, max = 10, message = "{validation.size}") private String name; @NotBlank(message = "{validation.account.account.notBlank}") + @Size(min = 10, message = "{validation.size}") private String account; - @NotBlank(message = "{validation.account.bank.notBlank}") - private String bank; + @NotNull(message = "{validation.account.bank.notBlank}") + private Bank bank; public AccountUpdateServiceRequest toServiceRequest() { return AccountUpdateServiceRequest.builder() diff --git a/Server/src/main/java/com/server/domain/adjustment/domain/Adjustment.java b/Server/src/main/java/com/server/domain/adjustment/domain/Adjustment.java index cadbec7d..f3d4142c 100644 --- a/Server/src/main/java/com/server/domain/adjustment/domain/Adjustment.java +++ b/Server/src/main/java/com/server/domain/adjustment/domain/Adjustment.java @@ -1,5 +1,6 @@ package com.server.domain.adjustment.domain; +import com.server.domain.account.domain.Bank; import com.server.domain.member.entity.Member; import com.server.global.entity.BaseEntity; import lombok.AccessLevel; @@ -25,7 +26,7 @@ public class Adjustment extends BaseEntity { private String account; - private String bank; + private Bank bank; private Integer amount; @@ -38,7 +39,7 @@ public class Adjustment extends BaseEntity { @JoinColumn(name = "member_id") private Member member; - private Adjustment(Integer year, Integer month, String name, String account, String bank, Integer amount, AdjustmentStatus adjustmentStatus, String reason, Member member) { + private Adjustment(Integer year, Integer month, String name, String account, Bank bank, Integer amount, AdjustmentStatus adjustmentStatus, String reason, Member member) { this.adjustmentYear = year; this.adjustmentMonth = month; this.name = name; diff --git a/Server/src/main/java/com/server/domain/adjustment/service/AdjustmentService.java b/Server/src/main/java/com/server/domain/adjustment/service/AdjustmentService.java index ea10ca62..3079360f 100644 --- a/Server/src/main/java/com/server/domain/adjustment/service/AdjustmentService.java +++ b/Server/src/main/java/com/server/domain/adjustment/service/AdjustmentService.java @@ -1,6 +1,7 @@ package com.server.domain.adjustment.service; import com.server.domain.account.domain.Account; +import com.server.domain.account.domain.Bank; import com.server.domain.account.repository.AccountRepository; import com.server.domain.adjustment.domain.Adjustment; import com.server.domain.adjustment.domain.AdjustmentStatus; @@ -11,6 +12,7 @@ import com.server.domain.adjustment.service.dto.response.*; import com.server.domain.member.entity.Member; import com.server.domain.member.repository.MemberRepository; +import com.server.global.exception.businessexception.accountexception.AccountNotValidException; import com.server.global.exception.businessexception.memberexception.MemberNotFoundException; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -72,6 +74,10 @@ public void updateAccount(Long loginMemberId, AccountUpdateServiceRequest reques Account account = getAccountOrNull(loginMemberId); + if(!request.getBank().checkAccount(request.getAccount())) { + throw new AccountNotValidException(); + } + if(account == null) { Member member = verifiedMember(loginMemberId); Account createdAccount = Account.createAccount(request.getName(), request.getAccount(), request.getBank(), member); diff --git a/Server/src/main/java/com/server/domain/adjustment/service/dto/request/AccountUpdateServiceRequest.java b/Server/src/main/java/com/server/domain/adjustment/service/dto/request/AccountUpdateServiceRequest.java index 0c463c7c..f4a9dcae 100644 --- a/Server/src/main/java/com/server/domain/adjustment/service/dto/request/AccountUpdateServiceRequest.java +++ b/Server/src/main/java/com/server/domain/adjustment/service/dto/request/AccountUpdateServiceRequest.java @@ -1,5 +1,6 @@ package com.server.domain.adjustment.service.dto.request; +import com.server.domain.account.domain.Bank; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -11,5 +12,5 @@ public class AccountUpdateServiceRequest { private String name; private String account; - private String bank; + private Bank bank; } diff --git a/Server/src/main/java/com/server/domain/adjustment/service/dto/response/AccountResponse.java b/Server/src/main/java/com/server/domain/adjustment/service/dto/response/AccountResponse.java index d51e614a..ce98e72f 100644 --- a/Server/src/main/java/com/server/domain/adjustment/service/dto/response/AccountResponse.java +++ b/Server/src/main/java/com/server/domain/adjustment/service/dto/response/AccountResponse.java @@ -1,6 +1,7 @@ package com.server.domain.adjustment.service.dto.response; import com.server.domain.account.domain.Account; +import com.server.domain.account.domain.Bank; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; @@ -12,7 +13,7 @@ public class AccountResponse { private String name; private String account; - private String bank; + private Bank bank; public static AccountResponse of(Account account) { @@ -20,7 +21,6 @@ public static AccountResponse of(Account account) { return AccountResponse.builder() .name("계좌 정보가 없습니다.") .account("계좌 정보가 없습니다.") - .bank("계좌 정보가 없습니다.") .build(); } diff --git a/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountException.java b/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountException.java new file mode 100644 index 00000000..ce80ba13 --- /dev/null +++ b/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountException.java @@ -0,0 +1,11 @@ +package com.server.global.exception.businessexception.accountexception; + +import com.server.global.exception.businessexception.BusinessException; +import org.springframework.http.HttpStatus; + +public abstract class AccountException extends BusinessException { + + protected AccountException(String errorCode, HttpStatus httpStatus, String message) { + super(errorCode, httpStatus, message); + } +} diff --git a/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountNotValidException.java b/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountNotValidException.java new file mode 100644 index 00000000..3930d9e0 --- /dev/null +++ b/Server/src/main/java/com/server/global/exception/businessexception/accountexception/AccountNotValidException.java @@ -0,0 +1,16 @@ +package com.server.global.exception.businessexception.accountexception; + +import com.server.global.exception.businessexception.answerexception.AnswerException; +import lombok.Getter; +import org.springframework.http.HttpStatus; + +@Getter +public class AccountNotValidException extends AccountException { + + public static final String MESSAGE = "계좌 번호가 유효하지 않습니다."; + public static final String CODE = "ANSWER-400"; + + public AccountNotValidException() { + super(CODE, HttpStatus.BAD_REQUEST, MESSAGE); + } +} diff --git a/Server/src/main/java/com/server/module/firmbank/FirmBankService.java b/Server/src/main/java/com/server/module/firmbank/FirmBankService.java index c4780413..ed22a72d 100644 --- a/Server/src/main/java/com/server/module/firmbank/FirmBankService.java +++ b/Server/src/main/java/com/server/module/firmbank/FirmBankService.java @@ -1,8 +1,9 @@ package com.server.module.firmbank; +import com.server.domain.account.domain.Bank; import com.server.module.firmbank.response.AdjustmentResult; public interface FirmBankService { - AdjustmentResult adjustment(String name, String account, String bank, int amount); + AdjustmentResult adjustment(String name, String account, Bank bank, int amount); } diff --git a/Server/src/main/java/com/server/module/firmbank/MockFirmBankService.java b/Server/src/main/java/com/server/module/firmbank/MockFirmBankService.java index 0f3fe03c..772d653e 100644 --- a/Server/src/main/java/com/server/module/firmbank/MockFirmBankService.java +++ b/Server/src/main/java/com/server/module/firmbank/MockFirmBankService.java @@ -1,5 +1,6 @@ package com.server.module.firmbank; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.domain.AdjustmentStatus; import com.server.module.firmbank.response.AdjustmentResult; import org.springframework.stereotype.Service; @@ -8,7 +9,7 @@ public class MockFirmBankService implements FirmBankService { @Override - public AdjustmentResult adjustment(String name, String account, String bank, int amount) { + public AdjustmentResult adjustment(String name, String account, Bank bank, int amount) { return AdjustmentResult.builder() .status(AdjustmentStatus.ADJUSTED) .reason(AdjustmentStatus.ADJUSTED.getDescription()) diff --git a/Server/src/test/java/com/server/domain/account/domain/BankTest.java b/Server/src/test/java/com/server/domain/account/domain/BankTest.java new file mode 100644 index 00000000..1e0316b5 --- /dev/null +++ b/Server/src/test/java/com/server/domain/account/domain/BankTest.java @@ -0,0 +1,172 @@ +package com.server.domain.account.domain; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; + +import java.util.Collection; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.DynamicTest.dynamicTest; + +class BankTest { + + @TestFactory + @DisplayName("계좌번호 유효성 검사") + Collection checkAccount() { + return List.of( + dynamicTest("(구) KB 국민은행", () -> { + //given + String account = "123-12-1234-123"; + + //when + boolean result = Bank.KB.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("(신) KB 국민은행", () -> { + //given + String account = "123456-12-123456"; + + //when + boolean result = Bank.KB.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("IBK", () -> { + //given + String account = "123-123456-12-123"; + + //when + boolean result = Bank.IBK.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("농협", () -> { + //given + String account = "123-1234-1234-12"; + + //when + boolean result = Bank.NH.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("(구) 신한은행", () -> { + //given + String account = "123-12-123456"; + + //when + boolean result = Bank.SH.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("(신) 신한은행", () -> { + //given + String account = "123-123-123456"; + + //when + boolean result = Bank.SH.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("우리은행", () -> { + //given + String account = "1234-123-123456"; + + //when + boolean result = Bank.WR.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("KEB 하나은행", () -> { + //given + String account = "123-123456-12345"; + + //when + boolean result = Bank.HN.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("(구) 외환은행", () -> { + //given + String account = "123-123456-123"; + + //when + boolean result = Bank.HN.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("씨티은행", () -> { + //given + String account = "123-123456-123"; + + //when + boolean result = Bank.CITY.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("DGB 대구은행", () -> { + //given + String account = "123-12-123456-1"; + + //when + boolean result = Bank.DGB.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("BNK 부산은행", () -> { + //given + String account = "123-1234-1234-12"; + + //when + boolean result = Bank.BNK.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("SC 제일은행", () -> { + //given + String account = "123-12-123456"; + + //when + boolean result = Bank.SC.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("케이뱅크", () -> { + //given + String account = "123-123-123456"; + + //when + boolean result = Bank.KBANK.checkAccount(account); + + //then + assertThat(result).isTrue(); + }), + dynamicTest("카카오뱅크", () -> { + //given + String account = "1234-12-1234567"; + + //when + boolean result = Bank.KAKAO.checkAccount(account); + + //then + assertThat(result).isTrue(); + }) + ); + } + +} \ No newline at end of file diff --git a/Server/src/test/java/com/server/domain/adjustment/controller/AdjustmentControllerTest.java b/Server/src/test/java/com/server/domain/adjustment/controller/AdjustmentControllerTest.java index d05916d6..de7d4a56 100644 --- a/Server/src/test/java/com/server/domain/adjustment/controller/AdjustmentControllerTest.java +++ b/Server/src/test/java/com/server/domain/adjustment/controller/AdjustmentControllerTest.java @@ -1,5 +1,6 @@ package com.server.domain.adjustment.controller; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.controller.dto.request.AccountUpdateApiRequest; import com.server.domain.adjustment.domain.AdjustmentStatus; import com.server.domain.adjustment.service.dto.response.*; @@ -150,7 +151,7 @@ void getAccount() throws Exception { AccountResponse response = AccountResponse.builder() .name("홍길*") .account("123-****-12314") - .bank("국민은행") + .bank(Bank.KB) .build(); given(adjustmentService.getAccount(anyLong())).willReturn(response); @@ -177,7 +178,7 @@ void getAccount() throws Exception { fieldWithPath("data").description("계좌 정보"), fieldWithPath("data.name").description("예금주"), fieldWithPath("data.account").description("계좌번호"), - fieldWithPath("data.bank").description("은행") + fieldWithPath("data.bank").description(generateLinkCode(Bank.class)) ) ) ); @@ -190,7 +191,7 @@ void getAccountNull() throws Exception { AccountResponse response = AccountResponse.builder() .name("계좌 정보가 없습니다.") .account("계좌 정보가 없습니다.") - .bank("계좌 정보가 없습니다.") + .bank(null) .build(); given(adjustmentService.getAccount(anyLong())).willReturn(response); @@ -217,7 +218,7 @@ void getAccountNull() throws Exception { fieldWithPath("data").description("계좌 정보"), fieldWithPath("data.name").description("예금주"), fieldWithPath("data.account").description("계좌번호"), - fieldWithPath("data.bank").description("은행") + fieldWithPath("data.bank").description("null") ) ) ); @@ -230,7 +231,7 @@ void updateAccount() throws Exception { AccountUpdateApiRequest request = AccountUpdateApiRequest.builder() .name("홍길동") .account("123-123-123123") - .bank("국민은행") + .bank(Bank.KB) .build(); //when @@ -257,7 +258,7 @@ void updateAccount() throws Exception { requestFields( fieldWithPath("name").description("예금주").attributes(getConstraint("name")), fieldWithPath("account").description("계좌번호").attributes(getConstraint("account")), - fieldWithPath("bank").description("은행").attributes(getConstraint("bank")) + fieldWithPath("bank").description(generateLinkCode(Bank.class)).attributes(getConstraint("bank")) ) ) ); diff --git a/Server/src/test/java/com/server/domain/adjustment/service/AdjustmentServiceTest.java b/Server/src/test/java/com/server/domain/adjustment/service/AdjustmentServiceTest.java index 0b275f6b..61a04481 100644 --- a/Server/src/test/java/com/server/domain/adjustment/service/AdjustmentServiceTest.java +++ b/Server/src/test/java/com/server/domain/adjustment/service/AdjustmentServiceTest.java @@ -1,6 +1,7 @@ package com.server.domain.adjustment.service; import com.server.domain.account.domain.Account; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.service.dto.request.AccountUpdateServiceRequest; import com.server.domain.member.entity.Member; import com.server.global.testhelper.ServiceTest; @@ -35,8 +36,8 @@ Collection updateAccount() { return List.of( dynamicTest("계좌정보가 없다면 생성한다.", ()-> { //given - String accountNumber = "123456789"; - String bank = "신한은행"; + String accountNumber = "123-12-123456"; + Bank bank = Bank.SH; String name = "홍길동"; AccountUpdateServiceRequest request = new AccountUpdateServiceRequest(name, accountNumber, bank); @@ -50,8 +51,8 @@ Collection updateAccount() { }), dynamicTest("계좌정보가 있다면 수정한다.", ()-> { //given - String accountNumber = "1234567892"; - String bank = "신한은행2"; + String accountNumber = "123-12-123456"; + Bank bank = Bank.SH; String name = "홍길동2"; AccountUpdateServiceRequest request = new AccountUpdateServiceRequest(name, accountNumber, bank); diff --git a/Server/src/test/java/com/server/global/restdocs/CommonControllerTest.java b/Server/src/test/java/com/server/global/restdocs/CommonControllerTest.java index 1411de32..d813c070 100644 --- a/Server/src/test/java/com/server/global/restdocs/CommonControllerTest.java +++ b/Server/src/test/java/com/server/global/restdocs/CommonControllerTest.java @@ -1,5 +1,6 @@ package com.server.global.restdocs; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.domain.AdjustmentStatus; import com.server.domain.answer.entity.AnswerStatus; import com.server.domain.member.entity.Grade; @@ -169,7 +170,8 @@ void enums() throws Exception { Grade.class, AdjustmentSort.class, MemberStatus.class, - AdjustmentStatus.class + AdjustmentStatus.class, + Bank.class ); // Enum의 이름값들을 요청 데이터로 사용하기 위해 Json 형태로 변환 diff --git a/Server/src/test/java/com/server/global/testhelper/RepositoryTest.java b/Server/src/test/java/com/server/global/testhelper/RepositoryTest.java index 078d7369..29a4f31d 100644 --- a/Server/src/test/java/com/server/global/testhelper/RepositoryTest.java +++ b/Server/src/test/java/com/server/global/testhelper/RepositoryTest.java @@ -1,6 +1,7 @@ package com.server.global.testhelper; import com.server.domain.account.domain.Account; +import com.server.domain.account.domain.Bank; import com.server.domain.adjustment.domain.Adjustment; import com.server.domain.adjustment.domain.AdjustmentStatus; import com.server.domain.answer.entity.Answer; @@ -331,7 +332,8 @@ protected Reply createAndSaveReplies(Member member, Video video) { } protected Account createAndSaveAccount(Member member) { - Account account = Account.createAccount("kim", "1234", "하나", member); + + Account account = Account.createAccount("kim", "1234", Bank.HN, member); em.persist(account);