diff --git a/README.md b/README.md index 87a487f..6c8a1b2 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Numble Challenge - Banking API - 테스트 할 API는 [API 문서](https://this-is-spear.github.io/hello-banking-api/src/main/resources/static/docs/index.html)에서 확인 할 수 있습니다. - 서버는 `run.sh` 를 실행하면 됩니다. +- ### Development Environment diff --git a/mysql/conf.d b/mysql/conf.d deleted file mode 100644 index e69de29..0000000 diff --git a/src/main/java/numble/bankingapi/BankingApiApplication.java b/src/main/java/bankingapi/BankingApiApplication.java similarity index 91% rename from src/main/java/numble/bankingapi/BankingApiApplication.java rename to src/main/java/bankingapi/BankingApiApplication.java index 5ecde1e..2a36ccc 100644 --- a/src/main/java/numble/bankingapi/BankingApiApplication.java +++ b/src/main/java/bankingapi/BankingApiApplication.java @@ -1,4 +1,4 @@ -package numble.bankingapi; +package bankingapi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/main/java/numble/bankingapi/HelloController.java b/src/main/java/bankingapi/HelloController.java similarity index 92% rename from src/main/java/numble/bankingapi/HelloController.java rename to src/main/java/bankingapi/HelloController.java index 4f0c806..b56662f 100644 --- a/src/main/java/numble/bankingapi/HelloController.java +++ b/src/main/java/bankingapi/HelloController.java @@ -1,4 +1,4 @@ -package numble.bankingapi; +package bankingapi; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/src/main/java/numble/bankingapi/alarm/application/BankingNotifyService.java b/src/main/java/bankingapi/alarm/application/BankingNotifyService.java similarity index 63% rename from src/main/java/numble/bankingapi/alarm/application/BankingNotifyService.java rename to src/main/java/bankingapi/alarm/application/BankingNotifyService.java index 6ba0fa4..b90b3c4 100644 --- a/src/main/java/numble/bankingapi/alarm/application/BankingNotifyService.java +++ b/src/main/java/bankingapi/alarm/application/BankingNotifyService.java @@ -1,11 +1,11 @@ -package numble.bankingapi.alarm.application; +package bankingapi.alarm.application; +import bankingapi.alarm.domain.AlarmService; +import bankingapi.alarm.dto.AlarmMessage; +import bankingapi.banking.domain.NotifyService; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; -import numble.bankingapi.alarm.domain.AlarmService; -import numble.bankingapi.alarm.dto.AlarmMessage; -import numble.bankingapi.banking.domain.NotifyService; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/alarm/domain/AlarmService.java b/src/main/java/bankingapi/alarm/domain/AlarmService.java similarity index 66% rename from src/main/java/numble/bankingapi/alarm/domain/AlarmService.java rename to src/main/java/bankingapi/alarm/domain/AlarmService.java index cb15de9..4d5c78f 100644 --- a/src/main/java/numble/bankingapi/alarm/domain/AlarmService.java +++ b/src/main/java/bankingapi/alarm/domain/AlarmService.java @@ -1,4 +1,4 @@ -package numble.bankingapi.alarm.domain; +package bankingapi.alarm.domain; public interface AlarmService { void notify(Long userId, String message); diff --git a/src/main/java/numble/bankingapi/alarm/dto/AlarmMessage.java b/src/main/java/bankingapi/alarm/dto/AlarmMessage.java similarity index 83% rename from src/main/java/numble/bankingapi/alarm/dto/AlarmMessage.java rename to src/main/java/bankingapi/alarm/dto/AlarmMessage.java index b619fa3..c55815d 100644 --- a/src/main/java/numble/bankingapi/alarm/dto/AlarmMessage.java +++ b/src/main/java/bankingapi/alarm/dto/AlarmMessage.java @@ -1,4 +1,4 @@ -package numble.bankingapi.alarm.dto; +package bankingapi.alarm.dto; public record AlarmMessage( TaskStatus status, diff --git a/src/main/java/numble/bankingapi/alarm/dto/TaskStatus.java b/src/main/java/bankingapi/alarm/dto/TaskStatus.java similarity index 84% rename from src/main/java/numble/bankingapi/alarm/dto/TaskStatus.java rename to src/main/java/bankingapi/alarm/dto/TaskStatus.java index 5d651dd..a1e597f 100644 --- a/src/main/java/numble/bankingapi/alarm/dto/TaskStatus.java +++ b/src/main/java/bankingapi/alarm/dto/TaskStatus.java @@ -1,4 +1,4 @@ -package numble.bankingapi.alarm.dto; +package bankingapi.alarm.dto; public enum TaskStatus { SUCCESS("성공"), diff --git a/src/main/java/numble/bankingapi/alarm/dto/TaskType.java b/src/main/java/bankingapi/alarm/dto/TaskType.java similarity index 85% rename from src/main/java/numble/bankingapi/alarm/dto/TaskType.java rename to src/main/java/bankingapi/alarm/dto/TaskType.java index 5b8fa55..39d6962 100644 --- a/src/main/java/numble/bankingapi/alarm/dto/TaskType.java +++ b/src/main/java/bankingapi/alarm/dto/TaskType.java @@ -1,4 +1,4 @@ -package numble.bankingapi.alarm.dto; +package bankingapi.alarm.dto; public enum TaskType { WITHDRAW("출금"), diff --git a/src/main/java/numble/bankingapi/alarm/infra/NumbleAlarmService.java b/src/main/java/bankingapi/alarm/infra/NumbleAlarmService.java similarity index 78% rename from src/main/java/numble/bankingapi/alarm/infra/NumbleAlarmService.java rename to src/main/java/bankingapi/alarm/infra/NumbleAlarmService.java index 8174725..5ec8849 100644 --- a/src/main/java/numble/bankingapi/alarm/infra/NumbleAlarmService.java +++ b/src/main/java/bankingapi/alarm/infra/NumbleAlarmService.java @@ -1,9 +1,9 @@ -package numble.bankingapi.alarm.infra; +package bankingapi.alarm.infra; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; -import numble.bankingapi.alarm.domain.AlarmService; +import bankingapi.alarm.domain.AlarmService; @Service public class NumbleAlarmService implements AlarmService { diff --git a/src/main/java/numble/bankingapi/banking/application/AccountApplicationService.java b/src/main/java/bankingapi/banking/application/AccountApplicationService.java similarity index 80% rename from src/main/java/numble/bankingapi/banking/application/AccountApplicationService.java rename to src/main/java/bankingapi/banking/application/AccountApplicationService.java index 60a6523..9154cb5 100644 --- a/src/main/java/numble/bankingapi/banking/application/AccountApplicationService.java +++ b/src/main/java/bankingapi/banking/application/AccountApplicationService.java @@ -1,29 +1,29 @@ -package numble.bankingapi.banking.application; +package bankingapi.banking.application; import java.util.stream.Collectors; +import bankingapi.alarm.dto.AlarmMessage; +import bankingapi.alarm.dto.TaskStatus; +import bankingapi.alarm.dto.TaskType; +import bankingapi.banking.exception.InvalidMemberException; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberService; +import bankingapi.social.domain.Friend; +import bankingapi.social.domain.FriendService; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; -import numble.bankingapi.alarm.dto.AlarmMessage; -import numble.bankingapi.alarm.dto.TaskStatus; -import numble.bankingapi.alarm.dto.TaskType; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.AccountHistory; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.AccountService; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.banking.domain.NotifyService; -import numble.bankingapi.banking.dto.HistoryResponse; -import numble.bankingapi.banking.dto.HistoryResponses; -import numble.bankingapi.banking.dto.TargetResponse; -import numble.bankingapi.banking.dto.TargetResponses; -import numble.bankingapi.banking.dto.TransferCommand; -import numble.bankingapi.banking.exception.InvalidMemberException; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberService; -import numble.bankingapi.social.domain.Friend; -import numble.bankingapi.social.domain.FriendService; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.AccountHistory; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountService; +import bankingapi.banking.domain.Money; +import bankingapi.banking.domain.NotifyService; +import bankingapi.banking.dto.HistoryResponse; +import bankingapi.banking.dto.HistoryResponses; +import bankingapi.banking.dto.TargetResponse; +import bankingapi.banking.dto.TargetResponses; +import bankingapi.banking.dto.TransferCommand; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/banking/application/ConcurrencyFacade.java b/src/main/java/bankingapi/banking/application/ConcurrencyFacade.java similarity index 79% rename from src/main/java/numble/bankingapi/banking/application/ConcurrencyFacade.java rename to src/main/java/bankingapi/banking/application/ConcurrencyFacade.java index a1e9711..510a3b1 100644 --- a/src/main/java/numble/bankingapi/banking/application/ConcurrencyFacade.java +++ b/src/main/java/bankingapi/banking/application/ConcurrencyFacade.java @@ -1,13 +1,13 @@ -package numble.bankingapi.banking.application; +package bankingapi.banking.application; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountService; +import bankingapi.banking.domain.Money; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import lombok.RequiredArgsConstructor; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.AccountService; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.concurrency.ConcurrencyManager; +import bankingapi.concurrency.ConcurrencyManager; @Service @RequiredArgsConstructor @@ -17,7 +17,7 @@ public class ConcurrencyFacade { @Transactional public void transferWithLock(AccountNumber accountNumber, AccountNumber toAccountNumber, - Money amount) { + Money amount) { concurrencyManager.executeWithLock(accountNumber.getNumber(), toAccountNumber.getNumber(), () -> accountService.transferMoney(accountNumber, toAccountNumber, amount) ); diff --git a/src/main/java/numble/bankingapi/banking/domain/Account.java b/src/main/java/bankingapi/banking/domain/Account.java similarity index 95% rename from src/main/java/numble/bankingapi/banking/domain/Account.java rename to src/main/java/bankingapi/banking/domain/Account.java index 9f33bdc..82e41d8 100644 --- a/src/main/java/numble/bankingapi/banking/domain/Account.java +++ b/src/main/java/bankingapi/banking/domain/Account.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.Objects; @@ -18,7 +18,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.common.BaseEntity; +import bankingapi.common.BaseEntity; @Getter @Entity diff --git a/src/main/java/numble/bankingapi/banking/domain/AccountHistory.java b/src/main/java/bankingapi/banking/domain/AccountHistory.java similarity index 97% rename from src/main/java/numble/bankingapi/banking/domain/AccountHistory.java rename to src/main/java/bankingapi/banking/domain/AccountHistory.java index e62540c..efa4d5d 100644 --- a/src/main/java/numble/bankingapi/banking/domain/AccountHistory.java +++ b/src/main/java/bankingapi/banking/domain/AccountHistory.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.Objects; @@ -17,7 +17,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.common.BaseEntity; +import bankingapi.common.BaseEntity; @Getter @Entity diff --git a/src/main/java/numble/bankingapi/banking/domain/AccountHistoryRepository.java b/src/main/java/bankingapi/banking/domain/AccountHistoryRepository.java similarity index 82% rename from src/main/java/numble/bankingapi/banking/domain/AccountHistoryRepository.java rename to src/main/java/bankingapi/banking/domain/AccountHistoryRepository.java index ee5cff6..fd2e2dd 100644 --- a/src/main/java/numble/bankingapi/banking/domain/AccountHistoryRepository.java +++ b/src/main/java/bankingapi/banking/domain/AccountHistoryRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.List; diff --git a/src/main/java/numble/bankingapi/banking/domain/AccountNumber.java b/src/main/java/bankingapi/banking/domain/AccountNumber.java similarity index 88% rename from src/main/java/numble/bankingapi/banking/domain/AccountNumber.java rename to src/main/java/bankingapi/banking/domain/AccountNumber.java index a27181f..1b78275 100644 --- a/src/main/java/numble/bankingapi/banking/domain/AccountNumber.java +++ b/src/main/java/bankingapi/banking/domain/AccountNumber.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.Objects; import java.util.regex.Pattern; @@ -9,7 +9,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.banking.exception.InvalidAccountNumberException; +import bankingapi.banking.exception.InvalidAccountNumberException; @Getter @ToString diff --git a/src/main/java/numble/bankingapi/banking/domain/AccountRepository.java b/src/main/java/bankingapi/banking/domain/AccountRepository.java similarity index 90% rename from src/main/java/numble/bankingapi/banking/domain/AccountRepository.java rename to src/main/java/bankingapi/banking/domain/AccountRepository.java index 50de616..19c7565 100644 --- a/src/main/java/numble/bankingapi/banking/domain/AccountRepository.java +++ b/src/main/java/bankingapi/banking/domain/AccountRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.List; import java.util.Optional; diff --git a/src/main/java/numble/bankingapi/banking/domain/AccountService.java b/src/main/java/bankingapi/banking/domain/AccountService.java similarity index 97% rename from src/main/java/numble/bankingapi/banking/domain/AccountService.java rename to src/main/java/bankingapi/banking/domain/AccountService.java index ebd523f..d75aa40 100644 --- a/src/main/java/numble/bankingapi/banking/domain/AccountService.java +++ b/src/main/java/bankingapi/banking/domain/AccountService.java @@ -1,13 +1,13 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import java.util.List; +import bankingapi.util.generator.AccountNumberGenerator; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import lombok.RequiredArgsConstructor; -import numble.bankingapi.util.generator.AccountNumberGenerator; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/banking/domain/HistoryType.java b/src/main/java/bankingapi/banking/domain/HistoryType.java similarity index 53% rename from src/main/java/numble/bankingapi/banking/domain/HistoryType.java rename to src/main/java/bankingapi/banking/domain/HistoryType.java index 63cf429..80ac51e 100644 --- a/src/main/java/numble/bankingapi/banking/domain/HistoryType.java +++ b/src/main/java/bankingapi/banking/domain/HistoryType.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; public enum HistoryType { DEPOSIT, diff --git a/src/main/java/numble/bankingapi/banking/domain/Money.java b/src/main/java/bankingapi/banking/domain/Money.java similarity index 89% rename from src/main/java/numble/bankingapi/banking/domain/Money.java rename to src/main/java/bankingapi/banking/domain/Money.java index 40a11b8..9df8247 100644 --- a/src/main/java/numble/bankingapi/banking/domain/Money.java +++ b/src/main/java/bankingapi/banking/domain/Money.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import jakarta.persistence.Embeddable; import lombok.AccessLevel; @@ -6,7 +6,7 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.banking.exception.NotNegativeMoneyException; +import bankingapi.banking.exception.NotNegativeMoneyException; @Getter @Embeddable diff --git a/src/main/java/bankingapi/banking/domain/NotifyService.java b/src/main/java/bankingapi/banking/domain/NotifyService.java new file mode 100644 index 0000000..d4c71d8 --- /dev/null +++ b/src/main/java/bankingapi/banking/domain/NotifyService.java @@ -0,0 +1,7 @@ +package bankingapi.banking.domain; + +import bankingapi.alarm.dto.AlarmMessage; + +public interface NotifyService { + void notify(Long userId, AlarmMessage alarmType); +} diff --git a/src/main/java/numble/bankingapi/banking/dto/HistoryResponse.java b/src/main/java/bankingapi/banking/dto/HistoryResponse.java similarity index 51% rename from src/main/java/numble/bankingapi/banking/dto/HistoryResponse.java rename to src/main/java/bankingapi/banking/dto/HistoryResponse.java index b62fa89..f6f5272 100644 --- a/src/main/java/numble/bankingapi/banking/dto/HistoryResponse.java +++ b/src/main/java/bankingapi/banking/dto/HistoryResponse.java @@ -1,10 +1,10 @@ -package numble.bankingapi.banking.dto; +package bankingapi.banking.dto; import java.time.LocalDateTime; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.HistoryType; -import numble.bankingapi.banking.domain.Money; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.HistoryType; +import bankingapi.banking.domain.Money; public record HistoryResponse( HistoryType historyType, diff --git a/src/main/java/numble/bankingapi/banking/dto/HistoryResponses.java b/src/main/java/bankingapi/banking/dto/HistoryResponses.java similarity index 72% rename from src/main/java/numble/bankingapi/banking/dto/HistoryResponses.java rename to src/main/java/bankingapi/banking/dto/HistoryResponses.java index 11f3503..5fd5e3a 100644 --- a/src/main/java/numble/bankingapi/banking/dto/HistoryResponses.java +++ b/src/main/java/bankingapi/banking/dto/HistoryResponses.java @@ -1,8 +1,8 @@ -package numble.bankingapi.banking.dto; +package bankingapi.banking.dto; import java.util.List; -import numble.bankingapi.banking.domain.Money; +import bankingapi.banking.domain.Money; public record HistoryResponses( Money balance, diff --git a/src/main/java/numble/bankingapi/banking/dto/TargetResponse.java b/src/main/java/bankingapi/banking/dto/TargetResponse.java similarity index 50% rename from src/main/java/numble/bankingapi/banking/dto/TargetResponse.java rename to src/main/java/bankingapi/banking/dto/TargetResponse.java index a5e8021..464b55f 100644 --- a/src/main/java/numble/bankingapi/banking/dto/TargetResponse.java +++ b/src/main/java/bankingapi/banking/dto/TargetResponse.java @@ -1,6 +1,6 @@ -package numble.bankingapi.banking.dto; +package bankingapi.banking.dto; -import numble.bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountNumber; public record TargetResponse( String name, diff --git a/src/main/java/numble/bankingapi/banking/dto/TargetResponses.java b/src/main/java/bankingapi/banking/dto/TargetResponses.java similarity index 70% rename from src/main/java/numble/bankingapi/banking/dto/TargetResponses.java rename to src/main/java/bankingapi/banking/dto/TargetResponses.java index 60d47b7..01c0a97 100644 --- a/src/main/java/numble/bankingapi/banking/dto/TargetResponses.java +++ b/src/main/java/bankingapi/banking/dto/TargetResponses.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.dto; +package bankingapi.banking.dto; import java.util.List; diff --git a/src/main/java/numble/bankingapi/banking/dto/TransferCommand.java b/src/main/java/bankingapi/banking/dto/TransferCommand.java similarity index 76% rename from src/main/java/numble/bankingapi/banking/dto/TransferCommand.java rename to src/main/java/bankingapi/banking/dto/TransferCommand.java index 1a2edbf..41d81c6 100644 --- a/src/main/java/numble/bankingapi/banking/dto/TransferCommand.java +++ b/src/main/java/bankingapi/banking/dto/TransferCommand.java @@ -1,9 +1,9 @@ -package numble.bankingapi.banking.dto; +package bankingapi.banking.dto; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import numble.bankingapi.banking.domain.Money; +import bankingapi.banking.domain.Money; @JsonSerialize @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) diff --git a/src/main/java/numble/bankingapi/banking/exception/InvalidAccountNumberException.java b/src/main/java/bankingapi/banking/exception/InvalidAccountNumberException.java similarity index 91% rename from src/main/java/numble/bankingapi/banking/exception/InvalidAccountNumberException.java rename to src/main/java/bankingapi/banking/exception/InvalidAccountNumberException.java index 2c9432e..9eb00af 100644 --- a/src/main/java/numble/bankingapi/banking/exception/InvalidAccountNumberException.java +++ b/src/main/java/bankingapi/banking/exception/InvalidAccountNumberException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.exception; +package bankingapi.banking.exception; public class InvalidAccountNumberException extends RuntimeException { public InvalidAccountNumberException(String message) { diff --git a/src/main/java/numble/bankingapi/banking/exception/InvalidMemberException.java b/src/main/java/bankingapi/banking/exception/InvalidMemberException.java similarity index 82% rename from src/main/java/numble/bankingapi/banking/exception/InvalidMemberException.java rename to src/main/java/bankingapi/banking/exception/InvalidMemberException.java index 0cc37f2..5d3bf20 100644 --- a/src/main/java/numble/bankingapi/banking/exception/InvalidMemberException.java +++ b/src/main/java/bankingapi/banking/exception/InvalidMemberException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.exception; +package bankingapi.banking.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/src/main/java/numble/bankingapi/banking/exception/NotNegativeMoneyException.java b/src/main/java/bankingapi/banking/exception/NotNegativeMoneyException.java similarity index 86% rename from src/main/java/numble/bankingapi/banking/exception/NotNegativeMoneyException.java rename to src/main/java/bankingapi/banking/exception/NotNegativeMoneyException.java index 8ac678e..aed9b77 100644 --- a/src/main/java/numble/bankingapi/banking/exception/NotNegativeMoneyException.java +++ b/src/main/java/bankingapi/banking/exception/NotNegativeMoneyException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.exception; +package bankingapi.banking.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/src/main/java/numble/bankingapi/banking/infra/JpaAccountHistoryRepository.java b/src/main/java/bankingapi/banking/infra/JpaAccountHistoryRepository.java similarity index 64% rename from src/main/java/numble/bankingapi/banking/infra/JpaAccountHistoryRepository.java rename to src/main/java/bankingapi/banking/infra/JpaAccountHistoryRepository.java index 62f86a0..1f57c3d 100644 --- a/src/main/java/numble/bankingapi/banking/infra/JpaAccountHistoryRepository.java +++ b/src/main/java/bankingapi/banking/infra/JpaAccountHistoryRepository.java @@ -1,13 +1,13 @@ -package numble.bankingapi.banking.infra; +package bankingapi.banking.infra; import java.util.List; +import bankingapi.banking.domain.AccountHistory; +import bankingapi.banking.domain.AccountNumber; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import numble.bankingapi.banking.domain.AccountHistory; -import numble.bankingapi.banking.domain.AccountHistoryRepository; -import numble.bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountHistoryRepository; @Repository public interface JpaAccountHistoryRepository extends JpaRepository, AccountHistoryRepository { diff --git a/src/main/java/numble/bankingapi/banking/infra/JpaAccountRepository.java b/src/main/java/bankingapi/banking/infra/JpaAccountRepository.java similarity index 82% rename from src/main/java/numble/bankingapi/banking/infra/JpaAccountRepository.java rename to src/main/java/bankingapi/banking/infra/JpaAccountRepository.java index c45eba4..106fa11 100644 --- a/src/main/java/numble/bankingapi/banking/infra/JpaAccountRepository.java +++ b/src/main/java/bankingapi/banking/infra/JpaAccountRepository.java @@ -1,17 +1,17 @@ -package numble.bankingapi.banking.infra; +package bankingapi.banking.infra; import java.util.List; import java.util.Optional; +import bankingapi.banking.domain.AccountNumber; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Lock; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import jakarta.persistence.LockModeType; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.AccountRepository; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.AccountRepository; @Repository public interface JpaAccountRepository extends JpaRepository, AccountRepository { diff --git a/src/main/java/numble/bankingapi/banking/ui/AccountController.java b/src/main/java/bankingapi/banking/ui/AccountController.java similarity index 89% rename from src/main/java/numble/bankingapi/banking/ui/AccountController.java rename to src/main/java/bankingapi/banking/ui/AccountController.java index 64bd9cd..1cb0857 100644 --- a/src/main/java/numble/bankingapi/banking/ui/AccountController.java +++ b/src/main/java/bankingapi/banking/ui/AccountController.java @@ -1,4 +1,4 @@ -package numble.bankingapi.banking.ui; +package bankingapi.banking.ui; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -12,11 +12,11 @@ import org.springframework.web.bind.annotation.RestController; import lombok.RequiredArgsConstructor; -import numble.bankingapi.banking.application.AccountApplicationService; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.banking.dto.HistoryResponses; -import numble.bankingapi.banking.dto.TargetResponses; -import numble.bankingapi.banking.dto.TransferCommand; +import bankingapi.banking.application.AccountApplicationService; +import bankingapi.banking.domain.Money; +import bankingapi.banking.dto.HistoryResponses; +import bankingapi.banking.dto.TargetResponses; +import bankingapi.banking.dto.TransferCommand; @RestController @RequestMapping("account") diff --git a/src/main/java/numble/bankingapi/common/BaseEntity.java b/src/main/java/bankingapi/common/BaseEntity.java similarity index 92% rename from src/main/java/numble/bankingapi/common/BaseEntity.java rename to src/main/java/bankingapi/common/BaseEntity.java index ac8b58b..0269cef 100644 --- a/src/main/java/numble/bankingapi/common/BaseEntity.java +++ b/src/main/java/bankingapi/common/BaseEntity.java @@ -1,4 +1,4 @@ -package numble.bankingapi.common; +package bankingapi.common; import java.time.LocalDateTime; diff --git a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManager.java b/src/main/java/bankingapi/concurrency/ConcurrencyManager.java similarity index 82% rename from src/main/java/numble/bankingapi/concurrency/ConcurrencyManager.java rename to src/main/java/bankingapi/concurrency/ConcurrencyManager.java index 5fd5303..e92f51a 100644 --- a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManager.java +++ b/src/main/java/bankingapi/concurrency/ConcurrencyManager.java @@ -1,4 +1,4 @@ -package numble.bankingapi.concurrency; +package bankingapi.concurrency; public interface ConcurrencyManager { void executeWithLock(String lockName1, String lockName2, Runnable runnable); diff --git a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java b/src/main/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java similarity index 98% rename from src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java rename to src/main/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java index 3999286..a7c3f68 100644 --- a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java +++ b/src/main/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLock.java @@ -1,4 +1,4 @@ -package numble.bankingapi.concurrency; +package bankingapi.concurrency; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java b/src/main/java/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java similarity index 94% rename from src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java rename to src/main/java/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java index 324ecb8..1567f40 100644 --- a/src/main/java/numble/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java +++ b/src/main/java/bankingapi/concurrency/ConcurrencyManagerWithSynchronized.java @@ -1,4 +1,4 @@ -package numble.bankingapi.concurrency; +package bankingapi.concurrency; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistory.java b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistory.java similarity index 93% rename from src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistory.java rename to src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistory.java index 7533cd4..49d7d6d 100644 --- a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistory.java +++ b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistory.java @@ -1,5 +1,6 @@ -package numble.bankingapi.idempotent.domain; +package bankingapi.idempotent.domain; +import bankingapi.common.BaseEntity; import org.springframework.http.HttpStatus; import jakarta.persistence.Column; @@ -12,7 +13,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.common.BaseEntity; @Entity @Getter diff --git a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java similarity index 93% rename from src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java rename to src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java index 5d33de5..41a70f9 100644 --- a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java +++ b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestHistoryService.java @@ -1,4 +1,4 @@ -package numble.bankingapi.idempotent.domain; +package bankingapi.idempotent.domain; import org.springframework.stereotype.Service; diff --git a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestRepository.java b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestRepository.java similarity index 80% rename from src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestRepository.java rename to src/main/java/bankingapi/idempotent/domain/IdempotentRequestRepository.java index 5fd083f..309c2e0 100644 --- a/src/main/java/numble/bankingapi/idempotent/domain/IdempotentRequestRepository.java +++ b/src/main/java/bankingapi/idempotent/domain/IdempotentRequestRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.idempotent.domain; +package bankingapi.idempotent.domain; import java.util.Optional; diff --git a/src/main/java/numble/bankingapi/idempotent/dto/ExceptionMessage.java b/src/main/java/bankingapi/idempotent/dto/ExceptionMessage.java similarity index 85% rename from src/main/java/numble/bankingapi/idempotent/dto/ExceptionMessage.java rename to src/main/java/bankingapi/idempotent/dto/ExceptionMessage.java index 67c136a..c02bb86 100644 --- a/src/main/java/numble/bankingapi/idempotent/dto/ExceptionMessage.java +++ b/src/main/java/bankingapi/idempotent/dto/ExceptionMessage.java @@ -1,4 +1,4 @@ -package numble.bankingapi.idempotent.dto; +package bankingapi.idempotent.dto; /** * https://datatracker.ietf.org/doc/draft-ietf-httpapi-idempotency-key-header/에서 참고했습니다. diff --git a/src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java b/src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java similarity index 86% rename from src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java rename to src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java index 91f65a0..852c62d 100644 --- a/src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java +++ b/src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyAdvice.java @@ -1,11 +1,10 @@ -package numble.bankingapi.idempotent.exception; +package bankingapi.idempotent.exception; +import bankingapi.idempotent.dto.ExceptionMessage; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; -import numble.bankingapi.idempotent.dto.ExceptionMessage; - @RestControllerAdvice public class InvalidIdempotencyAdvice { diff --git a/src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyKey.java b/src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyKey.java similarity index 57% rename from src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyKey.java rename to src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyKey.java index 7796c47..1439bdc 100644 --- a/src/main/java/numble/bankingapi/idempotent/exception/InvalidIdempotencyKey.java +++ b/src/main/java/bankingapi/idempotent/exception/InvalidIdempotencyKey.java @@ -1,4 +1,4 @@ -package numble.bankingapi.idempotent.exception; +package bankingapi.idempotent.exception; public class InvalidIdempotencyKey extends RuntimeException { diff --git a/src/main/java/numble/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java b/src/main/java/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java similarity index 69% rename from src/main/java/numble/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java rename to src/main/java/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java index 749f2fa..c980d86 100644 --- a/src/main/java/numble/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java +++ b/src/main/java/bankingapi/idempotent/infra/JpaIdempotentRequestRepository.java @@ -1,12 +1,12 @@ -package numble.bankingapi.idempotent.infra; +package bankingapi.idempotent.infra; import java.util.Optional; +import bankingapi.idempotent.domain.IdempotentRequestHistory; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistory; -import numble.bankingapi.idempotent.domain.IdempotentRequestRepository; +import bankingapi.idempotent.domain.IdempotentRequestRepository; @Repository public interface JpaIdempotentRequestRepository diff --git a/src/main/java/numble/bankingapi/member/application/CustomUserDetailService.java b/src/main/java/bankingapi/member/application/CustomUserDetailService.java similarity index 83% rename from src/main/java/numble/bankingapi/member/application/CustomUserDetailService.java rename to src/main/java/bankingapi/member/application/CustomUserDetailService.java index f824875..70647a0 100644 --- a/src/main/java/numble/bankingapi/member/application/CustomUserDetailService.java +++ b/src/main/java/bankingapi/member/application/CustomUserDetailService.java @@ -1,8 +1,9 @@ -package numble.bankingapi.member.application; +package bankingapi.member.application; import java.util.List; import java.util.stream.Collectors; +import bankingapi.member.domain.Member; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; @@ -11,9 +12,8 @@ import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.member.exception.NotExistMemberException; +import bankingapi.member.domain.MemberRepository; +import bankingapi.member.exception.NotExistMemberException; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/member/application/DuplicateEmailException.java b/src/main/java/bankingapi/member/application/DuplicateEmailException.java similarity index 75% rename from src/main/java/numble/bankingapi/member/application/DuplicateEmailException.java rename to src/main/java/bankingapi/member/application/DuplicateEmailException.java index dbd7ba3..4303ab5 100644 --- a/src/main/java/numble/bankingapi/member/application/DuplicateEmailException.java +++ b/src/main/java/bankingapi/member/application/DuplicateEmailException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.application; +package bankingapi.member.application; public class DuplicateEmailException extends RuntimeException { public DuplicateEmailException() { diff --git a/src/main/java/numble/bankingapi/member/application/MemberApplicationService.java b/src/main/java/bankingapi/member/application/MemberApplicationService.java similarity index 76% rename from src/main/java/numble/bankingapi/member/application/MemberApplicationService.java rename to src/main/java/bankingapi/member/application/MemberApplicationService.java index d134928..8e4e561 100644 --- a/src/main/java/numble/bankingapi/member/application/MemberApplicationService.java +++ b/src/main/java/bankingapi/member/application/MemberApplicationService.java @@ -1,14 +1,14 @@ -package numble.bankingapi.member.application; +package bankingapi.member.application; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberRepository; +import bankingapi.member.dto.MemberResponse; +import bankingapi.member.dto.RegisterCommand; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.member.dto.MemberResponse; -import numble.bankingapi.member.dto.RegisterCommand; -import numble.bankingapi.member.exception.NotExistMemberException; +import bankingapi.member.exception.NotExistMemberException; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/member/domain/Member.java b/src/main/java/bankingapi/member/domain/Member.java similarity index 94% rename from src/main/java/numble/bankingapi/member/domain/Member.java rename to src/main/java/bankingapi/member/domain/Member.java index 21b9043..8e9459f 100644 --- a/src/main/java/numble/bankingapi/member/domain/Member.java +++ b/src/main/java/bankingapi/member/domain/Member.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.domain; +package bankingapi.member.domain; import java.util.List; import java.util.Objects; @@ -19,8 +19,8 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; -import numble.bankingapi.common.BaseEntity; -import numble.bankingapi.member.exception.InvalidFormatException; +import bankingapi.common.BaseEntity; +import bankingapi.member.exception.InvalidFormatException; @Getter @Entity diff --git a/src/main/java/numble/bankingapi/member/domain/MemberRepository.java b/src/main/java/bankingapi/member/domain/MemberRepository.java similarity index 86% rename from src/main/java/numble/bankingapi/member/domain/MemberRepository.java rename to src/main/java/bankingapi/member/domain/MemberRepository.java index ac4b5a6..a51db68 100644 --- a/src/main/java/numble/bankingapi/member/domain/MemberRepository.java +++ b/src/main/java/bankingapi/member/domain/MemberRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.domain; +package bankingapi.member.domain; import java.util.List; import java.util.Optional; diff --git a/src/main/java/numble/bankingapi/member/domain/MemberService.java b/src/main/java/bankingapi/member/domain/MemberService.java similarity index 93% rename from src/main/java/numble/bankingapi/member/domain/MemberService.java rename to src/main/java/bankingapi/member/domain/MemberService.java index 3a33279..289d67c 100644 --- a/src/main/java/numble/bankingapi/member/domain/MemberService.java +++ b/src/main/java/bankingapi/member/domain/MemberService.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.domain; +package bankingapi.member.domain; import java.util.List; diff --git a/src/main/java/numble/bankingapi/member/domain/RoleType.java b/src/main/java/bankingapi/member/domain/RoleType.java similarity index 55% rename from src/main/java/numble/bankingapi/member/domain/RoleType.java rename to src/main/java/bankingapi/member/domain/RoleType.java index 35af344..9d4de17 100644 --- a/src/main/java/numble/bankingapi/member/domain/RoleType.java +++ b/src/main/java/bankingapi/member/domain/RoleType.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.domain; +package bankingapi.member.domain; public enum RoleType { ROLE_ADMIN, diff --git a/src/main/java/numble/bankingapi/member/dto/MemberResponse.java b/src/main/java/bankingapi/member/dto/MemberResponse.java similarity index 61% rename from src/main/java/numble/bankingapi/member/dto/MemberResponse.java rename to src/main/java/bankingapi/member/dto/MemberResponse.java index ca9c982..e21592f 100644 --- a/src/main/java/numble/bankingapi/member/dto/MemberResponse.java +++ b/src/main/java/bankingapi/member/dto/MemberResponse.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.dto; +package bankingapi.member.dto; public record MemberResponse( Long id, diff --git a/src/main/java/numble/bankingapi/member/dto/RegisterCommand.java b/src/main/java/bankingapi/member/dto/RegisterCommand.java similarity index 68% rename from src/main/java/numble/bankingapi/member/dto/RegisterCommand.java rename to src/main/java/bankingapi/member/dto/RegisterCommand.java index 1724f5a..4360a63 100644 --- a/src/main/java/numble/bankingapi/member/dto/RegisterCommand.java +++ b/src/main/java/bankingapi/member/dto/RegisterCommand.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.dto; +package bankingapi.member.dto; public record RegisterCommand( String email, diff --git a/src/main/java/numble/bankingapi/member/exception/InvalidFormatException.java b/src/main/java/bankingapi/member/exception/InvalidFormatException.java similarity index 94% rename from src/main/java/numble/bankingapi/member/exception/InvalidFormatException.java rename to src/main/java/bankingapi/member/exception/InvalidFormatException.java index c636306..9d78971 100644 --- a/src/main/java/numble/bankingapi/member/exception/InvalidFormatException.java +++ b/src/main/java/bankingapi/member/exception/InvalidFormatException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.exception; +package bankingapi.member.exception; public class InvalidFormatException extends RuntimeException { diff --git a/src/main/java/numble/bankingapi/member/exception/NotExistMemberException.java b/src/main/java/bankingapi/member/exception/NotExistMemberException.java similarity index 78% rename from src/main/java/numble/bankingapi/member/exception/NotExistMemberException.java rename to src/main/java/bankingapi/member/exception/NotExistMemberException.java index 7adb2f8..a07ea27 100644 --- a/src/main/java/numble/bankingapi/member/exception/NotExistMemberException.java +++ b/src/main/java/bankingapi/member/exception/NotExistMemberException.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.exception; +package bankingapi.member.exception; public class NotExistMemberException extends RuntimeException { public NotExistMemberException() { diff --git a/src/main/java/numble/bankingapi/member/infra/JpaMemberRepository.java b/src/main/java/bankingapi/member/infra/JpaMemberRepository.java similarity index 77% rename from src/main/java/numble/bankingapi/member/infra/JpaMemberRepository.java rename to src/main/java/bankingapi/member/infra/JpaMemberRepository.java index 764ee87..f437f01 100644 --- a/src/main/java/numble/bankingapi/member/infra/JpaMemberRepository.java +++ b/src/main/java/bankingapi/member/infra/JpaMemberRepository.java @@ -1,13 +1,13 @@ -package numble.bankingapi.member.infra; +package bankingapi.member.infra; import java.util.List; import java.util.Optional; +import bankingapi.member.domain.Member; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; +import bankingapi.member.domain.MemberRepository; @Repository public interface JpaMemberRepository extends JpaRepository, MemberRepository { diff --git a/src/main/java/numble/bankingapi/member/ui/MemberController.java b/src/main/java/bankingapi/member/ui/MemberController.java similarity index 85% rename from src/main/java/numble/bankingapi/member/ui/MemberController.java rename to src/main/java/bankingapi/member/ui/MemberController.java index f776b7e..1821696 100644 --- a/src/main/java/numble/bankingapi/member/ui/MemberController.java +++ b/src/main/java/bankingapi/member/ui/MemberController.java @@ -1,4 +1,4 @@ -package numble.bankingapi.member.ui; +package bankingapi.member.ui; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.RestController; import lombok.RequiredArgsConstructor; -import numble.bankingapi.member.application.MemberApplicationService; -import numble.bankingapi.member.dto.MemberResponse; -import numble.bankingapi.member.dto.RegisterCommand; +import bankingapi.member.application.MemberApplicationService; +import bankingapi.member.dto.MemberResponse; +import bankingapi.member.dto.RegisterCommand; @RestController @RequestMapping("members") diff --git a/src/main/java/numble/bankingapi/social/domain/ApprovalStatus.java b/src/main/java/bankingapi/social/domain/ApprovalStatus.java similarity index 60% rename from src/main/java/numble/bankingapi/social/domain/ApprovalStatus.java rename to src/main/java/bankingapi/social/domain/ApprovalStatus.java index 424b8b7..4222b1d 100644 --- a/src/main/java/numble/bankingapi/social/domain/ApprovalStatus.java +++ b/src/main/java/bankingapi/social/domain/ApprovalStatus.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; public enum ApprovalStatus { WAITING, diff --git a/src/main/java/numble/bankingapi/social/domain/AskedFriendHistory.java b/src/main/java/bankingapi/social/domain/AskedFriendHistory.java similarity index 97% rename from src/main/java/numble/bankingapi/social/domain/AskedFriendHistory.java rename to src/main/java/bankingapi/social/domain/AskedFriendHistory.java index 58cb4d3..da1ab94 100644 --- a/src/main/java/numble/bankingapi/social/domain/AskedFriendHistory.java +++ b/src/main/java/bankingapi/social/domain/AskedFriendHistory.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/numble/bankingapi/social/domain/AskedFriendHistoryRepository.java b/src/main/java/bankingapi/social/domain/AskedFriendHistoryRepository.java similarity index 90% rename from src/main/java/numble/bankingapi/social/domain/AskedFriendHistoryRepository.java rename to src/main/java/bankingapi/social/domain/AskedFriendHistoryRepository.java index 5b2375f..81bd3e6 100644 --- a/src/main/java/numble/bankingapi/social/domain/AskedFriendHistoryRepository.java +++ b/src/main/java/bankingapi/social/domain/AskedFriendHistoryRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import java.util.List; import java.util.Optional; diff --git a/src/main/java/numble/bankingapi/social/domain/Friend.java b/src/main/java/bankingapi/social/domain/Friend.java similarity index 96% rename from src/main/java/numble/bankingapi/social/domain/Friend.java rename to src/main/java/bankingapi/social/domain/Friend.java index 252bec4..41646be 100644 --- a/src/main/java/numble/bankingapi/social/domain/Friend.java +++ b/src/main/java/bankingapi/social/domain/Friend.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import jakarta.persistence.Column; import jakarta.persistence.Entity; diff --git a/src/main/java/numble/bankingapi/social/domain/FriendRepository.java b/src/main/java/bankingapi/social/domain/FriendRepository.java similarity index 78% rename from src/main/java/numble/bankingapi/social/domain/FriendRepository.java rename to src/main/java/bankingapi/social/domain/FriendRepository.java index 800ea73..cf58f73 100644 --- a/src/main/java/numble/bankingapi/social/domain/FriendRepository.java +++ b/src/main/java/bankingapi/social/domain/FriendRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import java.util.List; diff --git a/src/main/java/numble/bankingapi/social/domain/FriendService.java b/src/main/java/bankingapi/social/domain/FriendService.java similarity index 97% rename from src/main/java/numble/bankingapi/social/domain/FriendService.java rename to src/main/java/bankingapi/social/domain/FriendService.java index 2acc211..6e0d2de 100644 --- a/src/main/java/numble/bankingapi/social/domain/FriendService.java +++ b/src/main/java/bankingapi/social/domain/FriendService.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import java.util.List; diff --git a/src/main/java/numble/bankingapi/social/domain/SocialNetworkService.java b/src/main/java/bankingapi/social/domain/SocialNetworkService.java similarity index 89% rename from src/main/java/numble/bankingapi/social/domain/SocialNetworkService.java rename to src/main/java/bankingapi/social/domain/SocialNetworkService.java index 9fcaeaf..1a3fcdc 100644 --- a/src/main/java/numble/bankingapi/social/domain/SocialNetworkService.java +++ b/src/main/java/bankingapi/social/domain/SocialNetworkService.java @@ -1,17 +1,17 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import java.util.List; +import bankingapi.member.domain.Member; +import bankingapi.social.dto.AskedFriendResponse; +import bankingapi.social.dto.AskedFriendResponses; +import bankingapi.social.dto.FriendResponse; +import bankingapi.social.dto.FriendResponses; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import lombok.RequiredArgsConstructor; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberService; -import numble.bankingapi.social.dto.AskedFriendResponse; -import numble.bankingapi.social.dto.AskedFriendResponses; -import numble.bankingapi.social.dto.FriendResponse; -import numble.bankingapi.social.dto.FriendResponses; +import bankingapi.member.domain.MemberService; @Service @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/social/dto/AskedFriendResponse.java b/src/main/java/bankingapi/social/dto/AskedFriendResponse.java similarity index 73% rename from src/main/java/numble/bankingapi/social/dto/AskedFriendResponse.java rename to src/main/java/bankingapi/social/dto/AskedFriendResponse.java index ba451b3..c4ab979 100644 --- a/src/main/java/numble/bankingapi/social/dto/AskedFriendResponse.java +++ b/src/main/java/bankingapi/social/dto/AskedFriendResponse.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.dto; +package bankingapi.social.dto; public record AskedFriendResponse( Long requestId, diff --git a/src/main/java/numble/bankingapi/social/dto/AskedFriendResponses.java b/src/main/java/bankingapi/social/dto/AskedFriendResponses.java similarity index 85% rename from src/main/java/numble/bankingapi/social/dto/AskedFriendResponses.java rename to src/main/java/bankingapi/social/dto/AskedFriendResponses.java index 20a11c8..067dd01 100644 --- a/src/main/java/numble/bankingapi/social/dto/AskedFriendResponses.java +++ b/src/main/java/bankingapi/social/dto/AskedFriendResponses.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.dto; +package bankingapi.social.dto; import java.util.List; diff --git a/src/main/java/numble/bankingapi/social/dto/FriendResponse.java b/src/main/java/bankingapi/social/dto/FriendResponse.java similarity index 67% rename from src/main/java/numble/bankingapi/social/dto/FriendResponse.java rename to src/main/java/bankingapi/social/dto/FriendResponse.java index 92855f6..2f4b8e7 100644 --- a/src/main/java/numble/bankingapi/social/dto/FriendResponse.java +++ b/src/main/java/bankingapi/social/dto/FriendResponse.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.dto; +package bankingapi.social.dto; public record FriendResponse( Long userId, diff --git a/src/main/java/numble/bankingapi/social/dto/FriendResponses.java b/src/main/java/bankingapi/social/dto/FriendResponses.java similarity index 84% rename from src/main/java/numble/bankingapi/social/dto/FriendResponses.java rename to src/main/java/bankingapi/social/dto/FriendResponses.java index 04d2360..d989b3f 100644 --- a/src/main/java/numble/bankingapi/social/dto/FriendResponses.java +++ b/src/main/java/bankingapi/social/dto/FriendResponses.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.dto; +package bankingapi.social.dto; import java.util.List; diff --git a/src/main/java/numble/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java b/src/main/java/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java similarity index 73% rename from src/main/java/numble/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java rename to src/main/java/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java index c2e378b..6cc89d4 100644 --- a/src/main/java/numble/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java +++ b/src/main/java/bankingapi/social/infra/JpaAskedFriendHistoryRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.infra; +package bankingapi.social.infra; import java.util.List; import java.util.Optional; @@ -6,9 +6,9 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import numble.bankingapi.social.domain.ApprovalStatus; -import numble.bankingapi.social.domain.AskedFriendHistory; -import numble.bankingapi.social.domain.AskedFriendHistoryRepository; +import bankingapi.social.domain.ApprovalStatus; +import bankingapi.social.domain.AskedFriendHistory; +import bankingapi.social.domain.AskedFriendHistoryRepository; @Repository public interface JpaAskedFriendHistoryRepository diff --git a/src/main/java/numble/bankingapi/social/infra/JpaFriendRepository.java b/src/main/java/bankingapi/social/infra/JpaFriendRepository.java similarity index 70% rename from src/main/java/numble/bankingapi/social/infra/JpaFriendRepository.java rename to src/main/java/bankingapi/social/infra/JpaFriendRepository.java index 9bb8ab2..3ef2a84 100644 --- a/src/main/java/numble/bankingapi/social/infra/JpaFriendRepository.java +++ b/src/main/java/bankingapi/social/infra/JpaFriendRepository.java @@ -1,12 +1,12 @@ -package numble.bankingapi.social.infra; +package bankingapi.social.infra; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import numble.bankingapi.social.domain.Friend; -import numble.bankingapi.social.domain.FriendRepository; +import bankingapi.social.domain.Friend; +import bankingapi.social.domain.FriendRepository; @Repository public interface JpaFriendRepository extends JpaRepository, FriendRepository { diff --git a/src/main/java/numble/bankingapi/social/ui/SocialNetworkController.java b/src/main/java/bankingapi/social/ui/SocialNetworkController.java similarity index 91% rename from src/main/java/numble/bankingapi/social/ui/SocialNetworkController.java rename to src/main/java/bankingapi/social/ui/SocialNetworkController.java index 8b08bec..517e244 100644 --- a/src/main/java/numble/bankingapi/social/ui/SocialNetworkController.java +++ b/src/main/java/bankingapi/social/ui/SocialNetworkController.java @@ -1,4 +1,4 @@ -package numble.bankingapi.social.ui; +package bankingapi.social.ui; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.RestController; import lombok.RequiredArgsConstructor; -import numble.bankingapi.social.domain.SocialNetworkService; -import numble.bankingapi.social.dto.AskedFriendResponses; -import numble.bankingapi.social.dto.FriendResponses; +import bankingapi.social.domain.SocialNetworkService; +import bankingapi.social.dto.AskedFriendResponses; +import bankingapi.social.dto.FriendResponses; @RestController @RequestMapping("members") diff --git a/src/main/java/numble/bankingapi/util/config/JpaAuditingConfiguration.java b/src/main/java/bankingapi/util/config/JpaAuditingConfiguration.java similarity index 84% rename from src/main/java/numble/bankingapi/util/config/JpaAuditingConfiguration.java rename to src/main/java/bankingapi/util/config/JpaAuditingConfiguration.java index bd430d0..eebb70a 100644 --- a/src/main/java/numble/bankingapi/util/config/JpaAuditingConfiguration.java +++ b/src/main/java/bankingapi/util/config/JpaAuditingConfiguration.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.config; +package bankingapi.util.config; import org.springframework.context.annotation.Configuration; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; diff --git a/src/main/java/numble/bankingapi/util/config/SecurityConfiguration.java b/src/main/java/bankingapi/util/config/SecurityConfiguration.java similarity index 97% rename from src/main/java/numble/bankingapi/util/config/SecurityConfiguration.java rename to src/main/java/bankingapi/util/config/SecurityConfiguration.java index 3f0d54c..d4507db 100644 --- a/src/main/java/numble/bankingapi/util/config/SecurityConfiguration.java +++ b/src/main/java/bankingapi/util/config/SecurityConfiguration.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.config; +package bankingapi.util.config; import static org.springframework.security.config.Customizer.*; diff --git a/src/main/java/numble/bankingapi/util/config/WebMvcConfiguration.java b/src/main/java/bankingapi/util/config/WebMvcConfiguration.java similarity index 68% rename from src/main/java/numble/bankingapi/util/config/WebMvcConfiguration.java rename to src/main/java/bankingapi/util/config/WebMvcConfiguration.java index 2bdd88e..6bbf7b2 100644 --- a/src/main/java/numble/bankingapi/util/config/WebMvcConfiguration.java +++ b/src/main/java/bankingapi/util/config/WebMvcConfiguration.java @@ -1,17 +1,14 @@ -package numble.bankingapi.util.config; +package bankingapi.util.config; +import bankingapi.util.filter.IdempotentRequestInterceptor; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; -import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; -import numble.bankingapi.util.filter.IdempotentRequestInterceptor; -import numble.bankingapi.util.filter.PathMatcherInterceptor; -import numble.bankingapi.util.matcher.CustomPathContainer; +import bankingapi.util.filter.PathMatcherInterceptor; +import bankingapi.util.matcher.CustomPathContainer; @Component @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/util/data/DataLoader.java b/src/main/java/bankingapi/util/data/DataLoader.java similarity index 75% rename from src/main/java/numble/bankingapi/util/data/DataLoader.java rename to src/main/java/bankingapi/util/data/DataLoader.java index 1f36411..597dbf5 100644 --- a/src/main/java/numble/bankingapi/util/data/DataLoader.java +++ b/src/main/java/bankingapi/util/data/DataLoader.java @@ -1,19 +1,19 @@ -package numble.bankingapi.util.data; +package bankingapi.util.data; import java.util.HashMap; import java.util.List; import java.util.Map; +import bankingapi.member.domain.Member; import org.springframework.stereotype.Component; import lombok.RequiredArgsConstructor; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.AccountRepository; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.member.domain.RoleType; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.AccountRepository; +import bankingapi.banking.domain.Money; +import bankingapi.member.domain.MemberRepository; +import bankingapi.member.domain.RoleType; +import bankingapi.util.generator.AccountNumberGenerator; @Component @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/util/data/DataLoaderBootstrap.java b/src/main/java/bankingapi/util/data/DataLoaderBootstrap.java similarity index 93% rename from src/main/java/numble/bankingapi/util/data/DataLoaderBootstrap.java rename to src/main/java/bankingapi/util/data/DataLoaderBootstrap.java index 83f9c66..76888fc 100644 --- a/src/main/java/numble/bankingapi/util/data/DataLoaderBootstrap.java +++ b/src/main/java/bankingapi/util/data/DataLoaderBootstrap.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.data; +package bankingapi.util.data; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; diff --git a/src/main/java/numble/bankingapi/util/filter/IdempotentRequestInterceptor.java b/src/main/java/bankingapi/util/filter/IdempotentRequestInterceptor.java similarity index 88% rename from src/main/java/numble/bankingapi/util/filter/IdempotentRequestInterceptor.java rename to src/main/java/bankingapi/util/filter/IdempotentRequestInterceptor.java index 6d6297d..d72e84e 100644 --- a/src/main/java/numble/bankingapi/util/filter/IdempotentRequestInterceptor.java +++ b/src/main/java/bankingapi/util/filter/IdempotentRequestInterceptor.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.filter; +package bankingapi.util.filter; import java.io.IOException; @@ -11,9 +11,9 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistory; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistoryService; -import numble.bankingapi.idempotent.exception.InvalidIdempotencyKey; +import bankingapi.idempotent.domain.IdempotentRequestHistory; +import bankingapi.idempotent.domain.IdempotentRequestHistoryService; +import bankingapi.idempotent.exception.InvalidIdempotencyKey; @Slf4j @Component diff --git a/src/main/java/numble/bankingapi/util/filter/PathMatcherInterceptor.java b/src/main/java/bankingapi/util/filter/PathMatcherInterceptor.java similarity index 92% rename from src/main/java/numble/bankingapi/util/filter/PathMatcherInterceptor.java rename to src/main/java/bankingapi/util/filter/PathMatcherInterceptor.java index 65508d3..0b6b345 100644 --- a/src/main/java/numble/bankingapi/util/filter/PathMatcherInterceptor.java +++ b/src/main/java/bankingapi/util/filter/PathMatcherInterceptor.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.filter; +package bankingapi.util.filter; import org.springframework.http.HttpMethod; import org.springframework.web.servlet.HandlerInterceptor; @@ -7,7 +7,7 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import numble.bankingapi.util.matcher.CustomPathContainer; +import bankingapi.util.matcher.CustomPathContainer; @Slf4j @RequiredArgsConstructor diff --git a/src/main/java/numble/bankingapi/util/generator/AccountNumberGenerator.java b/src/main/java/bankingapi/util/generator/AccountNumberGenerator.java similarity index 88% rename from src/main/java/numble/bankingapi/util/generator/AccountNumberGenerator.java rename to src/main/java/bankingapi/util/generator/AccountNumberGenerator.java index 19bdc31..a0bab68 100644 --- a/src/main/java/numble/bankingapi/util/generator/AccountNumberGenerator.java +++ b/src/main/java/bankingapi/util/generator/AccountNumberGenerator.java @@ -1,10 +1,10 @@ -package numble.bankingapi.util.generator; +package bankingapi.util.generator; import java.util.List; import java.util.random.RandomGenerator; import java.util.stream.Collectors; -import numble.bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountNumber; public class AccountNumberGenerator { private static final RandomGenerator GENERATOR = RandomGenerator.getDefault(); diff --git a/src/main/java/numble/bankingapi/util/matcher/CustomPathContainer.java b/src/main/java/bankingapi/util/matcher/CustomPathContainer.java similarity index 97% rename from src/main/java/numble/bankingapi/util/matcher/CustomPathContainer.java rename to src/main/java/bankingapi/util/matcher/CustomPathContainer.java index dfd270d..be5185e 100644 --- a/src/main/java/numble/bankingapi/util/matcher/CustomPathContainer.java +++ b/src/main/java/bankingapi/util/matcher/CustomPathContainer.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util.matcher; +package bankingapi.util.matcher; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/numble/bankingapi/banking/domain/NotifyService.java b/src/main/java/numble/bankingapi/banking/domain/NotifyService.java deleted file mode 100644 index 9eec700..0000000 --- a/src/main/java/numble/bankingapi/banking/domain/NotifyService.java +++ /dev/null @@ -1,7 +0,0 @@ -package numble.bankingapi.banking.domain; - -import numble.bankingapi.alarm.dto.AlarmMessage; - -public interface NotifyService { - void notify(Long userId, AlarmMessage alarmType); -} diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index f5e3ce9..a74b9fc 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -10,3 +10,5 @@ spring: show-sql: true hibernate: ddl-auto: create + naming: + physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl \ No newline at end of file diff --git a/src/main/resources/static/docs/index.html b/src/main/resources/static/docs/index.html deleted file mode 100644 index 299fd16..0000000 --- a/src/main/resources/static/docs/index.html +++ /dev/null @@ -1,989 +0,0 @@ - - - - - - - -Money Transfer Service - - - - - - -
-
-

Banking API

-
-
-

기록 조회

-
-

HTTP request

-
-
-
GET /account/392-6355-379976/history?_csrf=A2IJuLxqwlOh2FKdI1cqnWk-cjDop6y477ZhpVQOFzwdZ7q_YlY8jooL8zeM6zSpEXoepVtaXwjewpqV3oEDwW02Ll4sBd_c HTTP/1.1
-Host: 127.0.0.1:8080
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-Content-Type: application/json
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-Content-Length: 1389
-
-{
-  "balance" : {
-    "amount" : 20000
-  },
-  "historyResponses" : [ {
-    "historyType" : "DEPOSIT",
-    "money" : {
-      "amount" : 20000
-    },
-    "fromAccountNumber" : {
-      "number" : "392-6355-379976"
-    },
-    "toAccountNumber" : {
-      "number" : "245-0824-866251"
-    },
-    "recordDate" : "2022-02-13T12:10:00"
-  }, {
-    "historyType" : "WITHDRAW",
-    "money" : {
-      "amount" : 5000
-    },
-    "fromAccountNumber" : {
-      "number" : "392-6355-379976"
-    },
-    "toAccountNumber" : {
-      "number" : "509-4766-574551"
-    },
-    "recordDate" : "2022-02-03T04:10:00"
-  }, {
-    "historyType" : "WITHDRAW",
-    "money" : {
-      "amount" : 10000
-    },
-    "fromAccountNumber" : {
-      "number" : "392-6355-379976"
-    },
-    "toAccountNumber" : {
-      "number" : "358-0552-451968"
-    },
-    "recordDate" : "2022-02-01T21:10:00"
-  }, {
-    "historyType" : "DEPOSIT",
-    "money" : {
-      "amount" : 100000
-    },
-    "fromAccountNumber" : {
-      "number" : "392-6355-379976"
-    },
-    "toAccountNumber" : {
-      "number" : "426-1609-807377"
-    },
-    "recordDate" : "2022-01-21T20:10:00"
-  }, {
-    "historyType" : "WITHDRAW",
-    "money" : {
-      "amount" : 15000
-    },
-    "fromAccountNumber" : {
-      "number" : "392-6355-379976"
-    },
-    "toAccountNumber" : {
-      "number" : "111-1947-554591"
-    },
-    "recordDate" : "2022-01-10T08:10:00"
-  } ]
-}
-
-
-
-
-
-

금액 입금

-
-

HTTP request

-
-
-
POST /account/392-6355-379976/deposit?_csrf=6J3YLhixz9JMbsEI0lO-CuQCiI_lCKOpyc-Tv6OYZLxqyV94jam5HS6EquRhCqdp5H6KO9NjpbeEMJCErazy3JevAdlc-mhM HTTP/1.1
-Content-Type: application/json;charset=UTF-8
-Idempotency-Key: 989e59ed-019c-4bc5-b4c3-35c1eca53972
-Content-Length: 22
-Host: 127.0.0.1:8080
-
-{
-  "amount" : 20000
-}
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

금액 출금

-
-

HTTP request

-
-
-
POST /account/392-6355-379976/withdraw?_csrf=dnEnHEvIQDtXqPsoM9KoINEGilFJS6rrXRxPejC-BBiQAID5R0YWei79dQt6m8pJA_-cQuJlp2l9L53GOyx3GASINXukZrLI HTTP/1.1
-Content-Type: application/json;charset=UTF-8
-Idempotency-Key: d12e01c7-3b7e-4ee4-881b-fcb4ac8dedfe
-Content-Length: 22
-Host: 127.0.0.1:8080
-
-{
-  "amount" : 20000
-}
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

계좌 이체

-
-

HTTP request

-
-
-
POST /account/392-6355-379976/transfer?_csrf=tssZ8kGRgIkZfkkgwTGQtGYT0ZlKMN_RmcD0TZeINowyqft8ga4skSSj47o0SigT8hyk0QUg_KEoA7v8-KHCLPPsALtRn8kY HTTP/1.1
-Content-Type: application/json;charset=UTF-8
-Idempotency-Key: 3581bd6d-53ef-4e8e-bed5-5776582a52c7
-Content-Length: 84
-Host: 127.0.0.1:8080
-
-{
-  "toAccountNumber" : "392-6355-379976",
-  "amount" : {
-    "amount" : 20000
-  }
-}
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

이체 대상 확인

-
-

HTTP request

-
-
-
GET /account/392-6355-379976/transfer/targets HTTP/1.1
-Host: 127.0.0.1:8080
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-Content-Type: application/json
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-Content-Length: 407
-
-{
-  "targets" : [ {
-    "name" : "name1",
-    "email" : "member1@email.com",
-    "accountNumber" : {
-      "number" : "682-2485-454471"
-    }
-  }, {
-    "name" : "name2",
-    "email" : "member2@email.com",
-    "accountNumber" : {
-      "number" : "598-6513-982615"
-    }
-  }, {
-    "name" : "name3",
-    "email" : "member3@email.com",
-    "accountNumber" : {
-      "number" : "911-9317-784044"
-    }
-  } ]
-}
-
-
-
-
-
-
-
-

Member API

-
-
-

회원가입

-
-

HTTP request

-
-
-
POST /members/register?_csrf=pauP98MiCD0pkD1j8xSkdYi0BZmx3gEGGvNulkG4ZgpfVlqqlMi5waITawsE81hTwjmQFr_QKPuI6Dcrf8NY8HGIBDw-Yj-Z HTTP/1.1
-Content-Type: application/json;charset=UTF-8
-Content-Length: 82
-Host: 127.0.0.1:8080
-
-{
-  "password" : "password",
-  "name" : "tis",
-  "email" : "rjsckdd12@gmail.com"
-}
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

사용자 조회

-
-

HTTP request

-
-
-
GET /members/me?_csrf=1btyhtbOPqL6ctQNrMlIcPxO0vs6FqwJFGur4hAjKLhSC6WUt9oT4uGtWMTXSuQ_leR8E5kv_8INd8okIg3J0SIRTtlgM5On HTTP/1.1
-Host: 127.0.0.1:8080
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-Content-Type: application/json
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-Content-Length: 45
-
-{
-  "id" : 2,
-  "name" : "member@email.com"
-}
-
-
-
-
-
-
-
-

Social API

-
-
-

친구 신청

-
-

HTTP request

-
-
-
POST /members/friends/2 HTTP/1.1
-Content-Type: application/x-www-form-urlencoded
-Host: 127.0.0.1:8080
-Content-Length: 102
-
-_csrf=D-TPusyG751k3y_3_WkSylvesR6PO8f0AiD0wywlzTp_NnN4OdL4jq6-jvxJ7BbPyEQm_zronCa8XfbZYxXNoRRBrl5HVxdB
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

친구 신청 승인

-
-

HTTP request

-
-
-
POST /members/friends/1/approval HTTP/1.1
-Content-Type: application/x-www-form-urlencoded
-Host: 127.0.0.1:8080
-Content-Length: 102
-
-_csrf=8SWw0I5aNyJGbLzMaKYoqJbzKW7nXc6YDI0zBpbPPxu9LUr2kBeG5u9iVUdrXd30CYscmaHEBA_Ta6y1ab5WMvWpXHrfS3PG
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

친구 신청 거절

-
-

HTTP request

-
-
-
POST /members/friends/1/rejected HTTP/1.1
-Content-Type: application/x-www-form-urlencoded
-Host: 127.0.0.1:8080
-Content-Length: 102
-
-_csrf=TOvcszaXbs-w9rDfK21pKOtzrsmnsYSojEgjq5asDl6Y6h_4f425ggOmXK6dz9TvHkBdHNsWg_CXhuCFuH4ayfCZO2362nnB
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-
-
-
-
-
-

친구 목록 조회

-
-

HTTP request

-
-
-
GET /members/friends?_csrf=f88i-ogrmA68K9wZXA3NFKRn6lPlPGAZ5iuVnLTPQeurWWIRGfZAmLsS_TeRHOl_aiD5LZ1VxzGDCAU01hzxrdf8JNPIb1sm HTTP/1.1
-Host: 127.0.0.1:8080
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-Content-Type: application/json
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-Content-Length: 192
-
-{
-  "friendResponses" : [ {
-    "userId" : 4,
-    "name" : "name",
-    "email" : "member@email.com"
-  }, {
-    "userId" : 11,
-    "name" : "name113",
-    "email" : "member14@email.com"
-  } ]
-}
-
-
-
-
-
-

친구 신청 목록 조회

-
-

HTTP request

-
-
-
GET /members/friends/requests?_csrf=6XOio0ycsrcXIs_TdprVm2-8SXU4EkdwC4RtQ70q1ZZ7d9dHj0SWmi3_hoQ6EP2yRrfh-FrZZBdcIX5dabUJeosTtKJNROV0 HTTP/1.1
-Host: 127.0.0.1:8080
-
-
-
-
-

HTTP response

-
-
-
HTTP/1.1 200 OK
-Content-Type: application/json
-X-Content-Type-Options: nosniff
-X-XSS-Protection: 0
-Cache-Control: no-cache, no-store, max-age=0, must-revalidate
-Pragma: no-cache
-Expires: 0
-X-Frame-Options: DENY
-Content-Length: 251
-
-{
-  "askedFriendResponses" : [ {
-    "requestId" : 2,
-    "fromUserId" : 13,
-    "name" : "name",
-    "email" : "member@gmail.com"
-  }, {
-    "requestId" : 22,
-    "fromUserId" : 133,
-    "name" : "name123",
-    "email" : "member123@email.com"
-  } ]
-}
-
-
-
-
-
-
-
- - - - - - \ No newline at end of file diff --git a/src/test/java/numble/bankingapi/BankingApiApplicationTests.java b/src/test/java/bankingapi/BankingApiApplicationTests.java similarity index 87% rename from src/test/java/numble/bankingapi/BankingApiApplicationTests.java rename to src/test/java/bankingapi/BankingApiApplicationTests.java index 2c6dc43..ee9624f 100644 --- a/src/test/java/numble/bankingapi/BankingApiApplicationTests.java +++ b/src/test/java/bankingapi/BankingApiApplicationTests.java @@ -1,4 +1,4 @@ -package numble.bankingapi; +package bankingapi; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/src/test/java/numble/bankingapi/acceptance/AcceptanceTest.java b/src/test/java/bankingapi/acceptance/AcceptanceTest.java similarity index 90% rename from src/test/java/numble/bankingapi/acceptance/AcceptanceTest.java rename to src/test/java/bankingapi/acceptance/AcceptanceTest.java index 99ab57d..f273401 100644 --- a/src/test/java/numble/bankingapi/acceptance/AcceptanceTest.java +++ b/src/test/java/bankingapi/acceptance/AcceptanceTest.java @@ -1,7 +1,8 @@ -package numble.bankingapi.acceptance; +package bankingapi.acceptance; import java.util.Map; +import bankingapi.util.DatabaseCleanup; import org.junit.jupiter.api.BeforeEach; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -11,8 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import numble.bankingapi.util.DatabaseCleanup; -import numble.bankingapi.util.data.DataLoader; +import bankingapi.util.data.DataLoader; @ActiveProfiles("test") @AutoConfigureMockMvc diff --git a/src/test/java/numble/bankingapi/acceptance/BankingAcceptanceTest.java b/src/test/java/bankingapi/acceptance/BankingAcceptanceTest.java similarity index 99% rename from src/test/java/numble/bankingapi/acceptance/BankingAcceptanceTest.java rename to src/test/java/bankingapi/acceptance/BankingAcceptanceTest.java index 75b1b61..71a5546 100644 --- a/src/test/java/numble/bankingapi/acceptance/BankingAcceptanceTest.java +++ b/src/test/java/bankingapi/acceptance/BankingAcceptanceTest.java @@ -1,4 +1,4 @@ -package numble.bankingapi.acceptance; +package bankingapi.acceptance; import static org.junit.jupiter.api.Assertions.*; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*; @@ -16,7 +16,7 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.ResultActions; -import numble.bankingapi.banking.dto.HistoryResponses; +import bankingapi.banking.dto.HistoryResponses; class BankingAcceptanceTest extends AcceptanceTest { private static final String IDEMPOTENT_KEY = "Idempotency-Key"; diff --git a/src/test/java/numble/bankingapi/acceptance/FriendAcceptanceTest.java b/src/test/java/bankingapi/acceptance/FriendAcceptanceTest.java similarity index 98% rename from src/test/java/numble/bankingapi/acceptance/FriendAcceptanceTest.java rename to src/test/java/bankingapi/acceptance/FriendAcceptanceTest.java index 36f8e99..0078dd6 100644 --- a/src/test/java/numble/bankingapi/acceptance/FriendAcceptanceTest.java +++ b/src/test/java/bankingapi/acceptance/FriendAcceptanceTest.java @@ -1,4 +1,4 @@ -package numble.bankingapi.acceptance; +package bankingapi.acceptance; import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*; @@ -13,7 +13,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; -import numble.bankingapi.social.dto.AskedFriendResponses; +import bankingapi.social.dto.AskedFriendResponses; class FriendAcceptanceTest extends AcceptanceTest { diff --git a/src/test/java/numble/bankingapi/acceptance/IdempotencyAcceptanceTest.java b/src/test/java/bankingapi/acceptance/IdempotencyAcceptanceTest.java similarity index 96% rename from src/test/java/numble/bankingapi/acceptance/IdempotencyAcceptanceTest.java rename to src/test/java/bankingapi/acceptance/IdempotencyAcceptanceTest.java index a21e6e1..8cdaf71 100644 --- a/src/test/java/numble/bankingapi/acceptance/IdempotencyAcceptanceTest.java +++ b/src/test/java/bankingapi/acceptance/IdempotencyAcceptanceTest.java @@ -1,4 +1,4 @@ -package numble.bankingapi.acceptance; +package bankingapi.acceptance; import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; diff --git a/src/test/java/numble/bankingapi/alarm/application/BankingNotifyServiceTest.java b/src/test/java/bankingapi/alarm/application/BankingNotifyServiceTest.java similarity index 69% rename from src/test/java/numble/bankingapi/alarm/application/BankingNotifyServiceTest.java rename to src/test/java/bankingapi/alarm/application/BankingNotifyServiceTest.java index b0cc00f..b59dff9 100644 --- a/src/test/java/numble/bankingapi/alarm/application/BankingNotifyServiceTest.java +++ b/src/test/java/bankingapi/alarm/application/BankingNotifyServiceTest.java @@ -1,11 +1,11 @@ -package numble.bankingapi.alarm.application; +package bankingapi.alarm.application; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import numble.bankingapi.alarm.dto.AlarmMessage; -import numble.bankingapi.alarm.dto.TaskStatus; -import numble.bankingapi.alarm.dto.TaskType; +import bankingapi.alarm.dto.AlarmMessage; +import bankingapi.alarm.dto.TaskStatus; +import bankingapi.alarm.dto.TaskType; class BankingNotifyServiceTest { diff --git a/src/test/java/numble/bankingapi/alarm/application/FakeNumbleAlarmService.java b/src/test/java/bankingapi/alarm/application/FakeNumbleAlarmService.java similarity index 69% rename from src/test/java/numble/bankingapi/alarm/application/FakeNumbleAlarmService.java rename to src/test/java/bankingapi/alarm/application/FakeNumbleAlarmService.java index dd5716a..f0564ab 100644 --- a/src/test/java/numble/bankingapi/alarm/application/FakeNumbleAlarmService.java +++ b/src/test/java/bankingapi/alarm/application/FakeNumbleAlarmService.java @@ -1,6 +1,6 @@ -package numble.bankingapi.alarm.application; +package bankingapi.alarm.application; -import numble.bankingapi.alarm.domain.AlarmService; +import bankingapi.alarm.domain.AlarmService; public class FakeNumbleAlarmService implements AlarmService { public void notify(Long userId, String message) { diff --git a/src/test/java/numble/bankingapi/alarm/dto/AlarmMessageTest.java b/src/test/java/bankingapi/alarm/dto/AlarmMessageTest.java similarity index 81% rename from src/test/java/numble/bankingapi/alarm/dto/AlarmMessageTest.java rename to src/test/java/bankingapi/alarm/dto/AlarmMessageTest.java index d27104b..af00acd 100644 --- a/src/test/java/numble/bankingapi/alarm/dto/AlarmMessageTest.java +++ b/src/test/java/bankingapi/alarm/dto/AlarmMessageTest.java @@ -1,7 +1,10 @@ -package numble.bankingapi.alarm.dto; +package bankingapi.alarm.dto; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.alarm.dto.AlarmMessage; +import bankingapi.alarm.dto.TaskStatus; +import bankingapi.alarm.dto.TaskType; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/numble/bankingapi/banking/application/AccountApplicationServiceTest.java b/src/test/java/bankingapi/banking/application/AccountApplicationServiceTest.java similarity index 65% rename from src/test/java/numble/bankingapi/banking/application/AccountApplicationServiceTest.java rename to src/test/java/bankingapi/banking/application/AccountApplicationServiceTest.java index f45a365..b7fe2d8 100644 --- a/src/test/java/numble/bankingapi/banking/application/AccountApplicationServiceTest.java +++ b/src/test/java/bankingapi/banking/application/AccountApplicationServiceTest.java @@ -1,12 +1,12 @@ -package numble.bankingapi.banking.application; +package bankingapi.banking.application; -import static numble.bankingapi.fixture.AccountFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; import java.util.List; +import bankingapi.fixture.AccountFixture; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -14,21 +14,21 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import numble.bankingapi.alarm.dto.AlarmMessage; -import numble.bankingapi.alarm.dto.TaskStatus; -import numble.bankingapi.alarm.dto.TaskType; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.AccountHistory; -import numble.bankingapi.banking.domain.AccountService; -import numble.bankingapi.banking.domain.HistoryType; -import numble.bankingapi.banking.domain.NotifyService; -import numble.bankingapi.banking.dto.TransferCommand; -import numble.bankingapi.banking.exception.InvalidMemberException; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberService; -import numble.bankingapi.member.domain.RoleType; -import numble.bankingapi.social.domain.Friend; -import numble.bankingapi.social.domain.FriendService; +import bankingapi.alarm.dto.AlarmMessage; +import bankingapi.alarm.dto.TaskStatus; +import bankingapi.alarm.dto.TaskType; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.AccountHistory; +import bankingapi.banking.domain.AccountService; +import bankingapi.banking.domain.HistoryType; +import bankingapi.banking.domain.NotifyService; +import bankingapi.banking.dto.TransferCommand; +import bankingapi.banking.exception.InvalidMemberException; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberService; +import bankingapi.member.domain.RoleType; +import bankingapi.social.domain.Friend; +import bankingapi.social.domain.FriendService; @ExtendWith(MockitoExtension.class) class AccountApplicationServiceTest { @@ -40,27 +40,27 @@ class AccountApplicationServiceTest { private static final Member 사용자 = new Member(사용자_ID, EMAIL, "name", "password", List.of(RoleType.ROLE_MEMBER.name())); private static final AccountHistory 첫_번째_기록 = AccountHistory.builder() - .fromAccountNumber(계좌번호) - .toAccountNumber(계좌번호) - .balance(이만원) - .money(만원) + .fromAccountNumber(AccountFixture.계좌번호) + .toAccountNumber(AccountFixture.계좌번호) + .balance(AccountFixture.이만원) + .money(AccountFixture.만원) .type(HistoryType.DEPOSIT) .build(); private static final AccountHistory 두_번째_기록 = AccountHistory.builder() - .fromAccountNumber(계좌번호) - .toAccountNumber(상대방_계좌번호) - .balance(만원) - .money(만원) + .fromAccountNumber(AccountFixture.계좌번호) + .toAccountNumber(AccountFixture.상대방_계좌번호) + .balance(AccountFixture.만원) + .money(AccountFixture.만원) .type(HistoryType.WITHDRAW) .build(); private static final Account 계좌 = Account.builder() - .accountNumber(계좌번호) - .balance(이만원) + .accountNumber(AccountFixture.계좌번호) + .balance(AccountFixture.이만원) .userId(사용자_ID) .build(); private static final Account 상대방_계좌 = Account.builder() - .accountNumber(상대방_계좌번호) - .balance(만원) + .accountNumber(AccountFixture.상대방_계좌번호) + .balance(AccountFixture.만원) .userId(상대방_ID) .build(); @Mock @@ -80,25 +80,25 @@ class AccountApplicationServiceTest { @DisplayName("계좌 사용기록을 반환한다.") void getHistory() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(사용자); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); when(accountService.findAccountHistoriesByFromAccountNumber(계좌)).thenReturn(List.of(첫_번째_기록, 두_번째_기록)); var responses = assertDoesNotThrow( - () -> accountApplicationService.getHistory(EMAIL, 계좌번호.getNumber()) + () -> accountApplicationService.getHistory(EMAIL, AccountFixture.계좌번호.getNumber()) ); assertThat(responses.historyResponses()).hasSize(2); - assertThat(responses.historyResponses().get(0).money()).isEqualTo(만원); + assertThat(responses.historyResponses().get(0).money()).isEqualTo(AccountFixture.만원); } @Test @DisplayName("계좌에 금액을 입금한다.") void deposit() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(사용자); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); doNothing().when(notifyService).notify(계좌.getUserId(), new AlarmMessage(TaskStatus.SUCCESS, TaskType.DEPOSIT)); assertDoesNotThrow( - () -> accountApplicationService.deposit(EMAIL, 계좌번호.getNumber(), 만원) + () -> accountApplicationService.deposit(EMAIL, AccountFixture.계좌번호.getNumber(), AccountFixture.만원) ); } @@ -106,9 +106,9 @@ void deposit() { @DisplayName("계좌에 금액을 입금한할 때 본인이 아니면 예외가 발생한다.") void deposit_accessInvalidMember() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(상대방); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); assertThatThrownBy( - () -> accountApplicationService.deposit(EMAIL, 계좌번호.getNumber(), 만원) + () -> accountApplicationService.deposit(EMAIL, AccountFixture.계좌번호.getNumber(), AccountFixture.만원) ).isInstanceOf(InvalidMemberException.class); } @@ -116,10 +116,10 @@ void deposit_accessInvalidMember() { @DisplayName("계좌에 금액을 출금한다.") void withdraw() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(사용자); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); doNothing().when(notifyService).notify(사용자_ID, new AlarmMessage(TaskStatus.SUCCESS, TaskType.WITHDRAW)); assertDoesNotThrow( - () -> accountApplicationService.withdraw(EMAIL, 계좌번호.getNumber(), 만원) + () -> accountApplicationService.withdraw(EMAIL, AccountFixture.계좌번호.getNumber(), AccountFixture.만원) ); } @@ -127,9 +127,9 @@ void withdraw() { @DisplayName("계좌에 금액을 출금할 때 본인이 아니면 예외가 발생한다.") void withdraw_accessInvalidMember() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(상대방); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); assertThatThrownBy( - () -> accountApplicationService.withdraw(EMAIL, 계좌번호.getNumber(), 만원) + () -> accountApplicationService.withdraw(EMAIL, AccountFixture.계좌번호.getNumber(), AccountFixture.만원) ).isInstanceOf(InvalidMemberException.class); } @@ -138,7 +138,7 @@ void withdraw_accessInvalidMember() { void transfer() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(사용자); doNothing().when(concurrencyFacade) - .transferWithLock(계좌.getAccountNumber(), 상대방_계좌.getAccountNumber(), 만원); + .transferWithLock(계좌.getAccountNumber(), 상대방_계좌.getAccountNumber(), AccountFixture.만원); when(accountService.getAccountByAccountNumber(계좌.getAccountNumber())).thenReturn(계좌); when(accountService.getAccountByAccountNumber(상대방_계좌.getAccountNumber())).thenReturn(상대방_계좌); @@ -148,8 +148,8 @@ void transfer() { .notify(상대방_계좌.getUserId(), new AlarmMessage(TaskStatus.SUCCESS, TaskType.DEPOSIT)); assertDoesNotThrow( - () -> accountApplicationService.transfer(EMAIL, 계좌번호.getNumber(), - new TransferCommand(상대방_계좌번호.getNumber(), 만원)) + () -> accountApplicationService.transfer(EMAIL, AccountFixture.계좌번호.getNumber(), + new TransferCommand(AccountFixture.상대방_계좌번호.getNumber(), AccountFixture.만원)) ); } @@ -157,20 +157,20 @@ void transfer() { @DisplayName("이체할 때 본인이 아니면 안된다.") void transfer_accessInvalidMember() { when(memberService.findByEmail(사용자.getEmail())).thenReturn(상대방); - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); when(accountService.getAccountByAccountNumber(계좌.getAccountNumber())).thenReturn(계좌); when(accountService.getAccountByAccountNumber(상대방_계좌.getAccountNumber())).thenReturn(상대방_계좌); assertThatThrownBy( - () -> accountApplicationService.transfer(EMAIL, 계좌번호.getNumber(), - new TransferCommand(상대방_계좌번호.getNumber(), 만원)) + () -> accountApplicationService.transfer(EMAIL, AccountFixture.계좌번호.getNumber(), + new TransferCommand(AccountFixture.상대방_계좌번호.getNumber(), AccountFixture.만원)) ).isInstanceOf(InvalidMemberException.class); } @Test @DisplayName("계좌 이체할 상대방을 찾는다.") void getTargets() { - when(accountService.getAccountByAccountNumber(계좌번호)).thenReturn(계좌); + when(accountService.getAccountByAccountNumber(AccountFixture.계좌번호)).thenReturn(계좌); when(memberService.findByEmail(EMAIL)).thenReturn(사용자); when(friendService.findFriends(사용자_ID)).thenReturn(List.of(new Friend(사용자_ID, 상대방_ID))); when(memberService.findAllById(List.of(상대방_ID))).thenReturn(List.of(상대방)); diff --git a/src/test/java/numble/bankingapi/banking/domain/AccountHistoryServiceTest.java b/src/test/java/bankingapi/banking/domain/AccountHistoryServiceTest.java similarity index 93% rename from src/test/java/numble/bankingapi/banking/domain/AccountHistoryServiceTest.java rename to src/test/java/bankingapi/banking/domain/AccountHistoryServiceTest.java index 458e14c..fdf47ff 100644 --- a/src/test/java/numble/bankingapi/banking/domain/AccountHistoryServiceTest.java +++ b/src/test/java/bankingapi/banking/domain/AccountHistoryServiceTest.java @@ -1,18 +1,18 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; -import static numble.bankingapi.fixture.AccountFixture.*; +import static bankingapi.fixture.AccountFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.fake.FakeAccountHistoryRepository; +import bankingapi.fake.FakeAccountRepository; +import bankingapi.fake.FakeMemberRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import numble.bankingapi.fake.FakeAccountHistoryRepository; -import numble.bankingapi.fake.FakeAccountRepository; -import numble.bankingapi.fake.FakeMemberRepository; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.member.domain.Member; +import bankingapi.util.generator.AccountNumberGenerator; class AccountHistoryServiceTest { FakeAccountRepository accountRepository = new FakeAccountRepository(); diff --git a/src/test/java/numble/bankingapi/banking/domain/AccountHistoryTest.java b/src/test/java/bankingapi/banking/domain/AccountHistoryTest.java similarity index 96% rename from src/test/java/numble/bankingapi/banking/domain/AccountHistoryTest.java rename to src/test/java/bankingapi/banking/domain/AccountHistoryTest.java index 13c5498..1677281 100644 --- a/src/test/java/numble/bankingapi/banking/domain/AccountHistoryTest.java +++ b/src/test/java/bankingapi/banking/domain/AccountHistoryTest.java @@ -1,6 +1,6 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; -import static numble.bankingapi.fixture.AccountFixture.*; +import static bankingapi.fixture.AccountFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; diff --git a/src/test/java/numble/bankingapi/banking/domain/AccountNumberTest.java b/src/test/java/bankingapi/banking/domain/AccountNumberTest.java similarity index 89% rename from src/test/java/numble/bankingapi/banking/domain/AccountNumberTest.java rename to src/test/java/bankingapi/banking/domain/AccountNumberTest.java index a135737..a677194 100644 --- a/src/test/java/numble/bankingapi/banking/domain/AccountNumberTest.java +++ b/src/test/java/bankingapi/banking/domain/AccountNumberTest.java @@ -1,14 +1,15 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.banking.domain.AccountNumber; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.NullAndEmptySource; import org.junit.jupiter.params.provider.ValueSource; -import numble.bankingapi.banking.exception.InvalidAccountNumberException; +import bankingapi.banking.exception.InvalidAccountNumberException; class AccountNumberTest { diff --git a/src/test/java/numble/bankingapi/banking/domain/AccountServiceTest.java b/src/test/java/bankingapi/banking/domain/AccountServiceTest.java similarity index 93% rename from src/test/java/numble/bankingapi/banking/domain/AccountServiceTest.java rename to src/test/java/bankingapi/banking/domain/AccountServiceTest.java index 731ca76..6799844 100644 --- a/src/test/java/numble/bankingapi/banking/domain/AccountServiceTest.java +++ b/src/test/java/bankingapi/banking/domain/AccountServiceTest.java @@ -1,21 +1,21 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; -import static numble.bankingapi.fixture.AccountFixture.*; +import static bankingapi.fixture.AccountFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import java.util.List; +import bankingapi.fake.FakeAccountHistoryRepository; +import bankingapi.fake.FakeAccountRepository; +import bankingapi.fake.FakeMemberRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import numble.bankingapi.banking.exception.NotNegativeMoneyException; -import numble.bankingapi.fake.FakeAccountHistoryRepository; -import numble.bankingapi.fake.FakeAccountRepository; -import numble.bankingapi.fake.FakeMemberRepository; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.banking.exception.NotNegativeMoneyException; +import bankingapi.member.domain.Member; +import bankingapi.util.generator.AccountNumberGenerator; class AccountServiceTest { private final FakeMemberRepository memberRepository = new FakeMemberRepository(); diff --git a/src/test/java/numble/bankingapi/banking/domain/AccountTest.java b/src/test/java/bankingapi/banking/domain/AccountTest.java similarity index 93% rename from src/test/java/numble/bankingapi/banking/domain/AccountTest.java rename to src/test/java/bankingapi/banking/domain/AccountTest.java index 64abf9b..fbefdd8 100644 --- a/src/test/java/numble/bankingapi/banking/domain/AccountTest.java +++ b/src/test/java/bankingapi/banking/domain/AccountTest.java @@ -1,6 +1,6 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; -import static numble.bankingapi.fixture.AccountFixture.*; +import static bankingapi.fixture.AccountFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.NullSource; -import numble.bankingapi.banking.exception.NotNegativeMoneyException; +import bankingapi.banking.exception.NotNegativeMoneyException; class AccountTest { diff --git a/src/test/java/numble/bankingapi/banking/domain/MoneyTest.java b/src/test/java/bankingapi/banking/domain/MoneyTest.java similarity index 85% rename from src/test/java/numble/bankingapi/banking/domain/MoneyTest.java rename to src/test/java/bankingapi/banking/domain/MoneyTest.java index a649eb9..1eb6562 100644 --- a/src/test/java/numble/bankingapi/banking/domain/MoneyTest.java +++ b/src/test/java/bankingapi/banking/domain/MoneyTest.java @@ -1,13 +1,14 @@ -package numble.bankingapi.banking.domain; +package bankingapi.banking.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.banking.domain.Money; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import numble.bankingapi.banking.exception.NotNegativeMoneyException; +import bankingapi.banking.exception.NotNegativeMoneyException; class MoneyTest { diff --git a/src/test/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java b/src/test/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java similarity index 90% rename from src/test/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java rename to src/test/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java index c156209..fdf0791 100644 --- a/src/test/java/numble/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java +++ b/src/test/java/bankingapi/concurrency/ConcurrencyManagerWithNamedLockTest.java @@ -1,19 +1,20 @@ -package numble.bankingapi.concurrency; +package bankingapi.concurrency; import static org.assertj.core.api.Assertions.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; +import bankingapi.concurrency.ConcurrencyManager; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.Money; +import bankingapi.util.generator.AccountNumberGenerator; @SpringBootTest class ConcurrencyManagerWithNamedLockTest { diff --git a/src/test/java/numble/bankingapi/documentation/AccountDocumentation.java b/src/test/java/bankingapi/documentation/AccountDocumentation.java similarity index 93% rename from src/test/java/numble/bankingapi/documentation/AccountDocumentation.java rename to src/test/java/bankingapi/documentation/AccountDocumentation.java index d358525..54465b3 100644 --- a/src/test/java/numble/bankingapi/documentation/AccountDocumentation.java +++ b/src/test/java/bankingapi/documentation/AccountDocumentation.java @@ -1,7 +1,7 @@ -package numble.bankingapi.documentation; +package bankingapi.documentation; -import static numble.bankingapi.fixture.AccountFixture.*; -import static numble.bankingapi.fixture.DocumentationFixture.*; +import static bankingapi.fixture.AccountFixture.*; +import static bankingapi.fixture.DocumentationFixture.*; import static org.mockito.Mockito.*; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*; import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.*; @@ -15,8 +15,8 @@ import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; -import numble.bankingapi.banking.dto.TransferCommand; -import numble.bankingapi.util.WithMockMember; +import bankingapi.banking.dto.TransferCommand; +import bankingapi.util.WithMockMember; class AccountDocumentation extends DocumentationTemplate { private static final String IDEMPOTENT_KEY = "Idempotency-Key"; diff --git a/src/test/java/numble/bankingapi/documentation/DocumentationTemplate.java b/src/test/java/bankingapi/documentation/DocumentationTemplate.java similarity index 83% rename from src/test/java/numble/bankingapi/documentation/DocumentationTemplate.java rename to src/test/java/bankingapi/documentation/DocumentationTemplate.java index ac8f5a8..8d1e5ad 100644 --- a/src/test/java/numble/bankingapi/documentation/DocumentationTemplate.java +++ b/src/test/java/bankingapi/documentation/DocumentationTemplate.java @@ -1,4 +1,4 @@ -package numble.bankingapi.documentation; +package bankingapi.documentation; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; @@ -21,12 +21,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import numble.bankingapi.banking.application.AccountApplicationService; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistoryService; -import numble.bankingapi.member.application.MemberApplicationService; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.social.domain.SocialNetworkService; -import numble.bankingapi.util.matcher.CustomPathContainer; +import bankingapi.banking.application.AccountApplicationService; +import bankingapi.idempotent.domain.IdempotentRequestHistoryService; +import bankingapi.member.application.MemberApplicationService; +import bankingapi.member.domain.MemberRepository; +import bankingapi.social.domain.SocialNetworkService; +import bankingapi.util.matcher.CustomPathContainer; @WebMvcTest @ExtendWith(RestDocumentationExtension.class) diff --git a/src/test/java/numble/bankingapi/documentation/HelloDocumentation.java b/src/test/java/bankingapi/documentation/HelloDocumentation.java similarity index 91% rename from src/test/java/numble/bankingapi/documentation/HelloDocumentation.java rename to src/test/java/bankingapi/documentation/HelloDocumentation.java index e68f597..b63606b 100644 --- a/src/test/java/numble/bankingapi/documentation/HelloDocumentation.java +++ b/src/test/java/bankingapi/documentation/HelloDocumentation.java @@ -1,4 +1,4 @@ -package numble.bankingapi.documentation; +package bankingapi.documentation; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*; import static org.springframework.restdocs.request.RequestDocumentation.*; @@ -9,7 +9,7 @@ import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultHandlers; -import numble.bankingapi.util.WithMockMember; +import bankingapi.util.WithMockMember; class HelloDocumentation extends DocumentationTemplate { diff --git a/src/test/java/numble/bankingapi/documentation/MemberDocumentation.java b/src/test/java/bankingapi/documentation/MemberDocumentation.java similarity index 91% rename from src/test/java/numble/bankingapi/documentation/MemberDocumentation.java rename to src/test/java/bankingapi/documentation/MemberDocumentation.java index 1e7c57b..39f0241 100644 --- a/src/test/java/numble/bankingapi/documentation/MemberDocumentation.java +++ b/src/test/java/bankingapi/documentation/MemberDocumentation.java @@ -1,4 +1,4 @@ -package numble.bankingapi.documentation; +package bankingapi.documentation; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; @@ -15,9 +15,9 @@ import org.springframework.http.MediaType; import org.springframework.test.web.servlet.result.MockMvcResultHandlers; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.dto.MemberResponse; -import numble.bankingapi.util.WithMockMember; +import bankingapi.member.domain.Member; +import bankingapi.member.dto.MemberResponse; +import bankingapi.util.WithMockMember; class MemberDocumentation extends DocumentationTemplate { diff --git a/src/test/java/numble/bankingapi/documentation/SocialDocumentation.java b/src/test/java/bankingapi/documentation/SocialDocumentation.java similarity index 93% rename from src/test/java/numble/bankingapi/documentation/SocialDocumentation.java rename to src/test/java/bankingapi/documentation/SocialDocumentation.java index 238a1e1..86f82b6 100644 --- a/src/test/java/numble/bankingapi/documentation/SocialDocumentation.java +++ b/src/test/java/bankingapi/documentation/SocialDocumentation.java @@ -1,4 +1,4 @@ -package numble.bankingapi.documentation; +package bankingapi.documentation; import static org.mockito.Mockito.*; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.*; @@ -13,11 +13,11 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import numble.bankingapi.social.dto.AskedFriendResponse; -import numble.bankingapi.social.dto.AskedFriendResponses; -import numble.bankingapi.social.dto.FriendResponse; -import numble.bankingapi.social.dto.FriendResponses; -import numble.bankingapi.util.WithMockMember; +import bankingapi.social.dto.AskedFriendResponse; +import bankingapi.social.dto.AskedFriendResponses; +import bankingapi.social.dto.FriendResponse; +import bankingapi.social.dto.FriendResponses; +import bankingapi.util.WithMockMember; class SocialDocumentation extends DocumentationTemplate { diff --git a/src/test/java/numble/bankingapi/fake/FakeAccountHistoryRepository.java b/src/test/java/bankingapi/fake/FakeAccountHistoryRepository.java similarity index 79% rename from src/test/java/numble/bankingapi/fake/FakeAccountHistoryRepository.java rename to src/test/java/bankingapi/fake/FakeAccountHistoryRepository.java index 1735712..29e289c 100644 --- a/src/test/java/numble/bankingapi/fake/FakeAccountHistoryRepository.java +++ b/src/test/java/bankingapi/fake/FakeAccountHistoryRepository.java @@ -1,12 +1,12 @@ -package numble.bankingapi.fake; +package bankingapi.fake; import java.util.HashMap; import java.util.List; import java.util.Map; -import numble.bankingapi.banking.domain.AccountHistory; -import numble.bankingapi.banking.domain.AccountHistoryRepository; -import numble.bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountHistory; +import bankingapi.banking.domain.AccountHistoryRepository; +import bankingapi.banking.domain.AccountNumber; public class FakeAccountHistoryRepository implements AccountHistoryRepository { Map maps = new HashMap<>(); diff --git a/src/test/java/numble/bankingapi/fake/FakeAccountRepository.java b/src/test/java/bankingapi/fake/FakeAccountRepository.java similarity index 87% rename from src/test/java/numble/bankingapi/fake/FakeAccountRepository.java rename to src/test/java/bankingapi/fake/FakeAccountRepository.java index 8610334..011d008 100644 --- a/src/test/java/numble/bankingapi/fake/FakeAccountRepository.java +++ b/src/test/java/bankingapi/fake/FakeAccountRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.fake; +package bankingapi.fake; import java.util.HashMap; import java.util.List; @@ -6,9 +6,9 @@ import java.util.Optional; import java.util.stream.Collectors; -import numble.bankingapi.banking.domain.Account; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.AccountRepository; +import bankingapi.banking.domain.Account; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.AccountRepository; public class FakeAccountRepository implements AccountRepository { diff --git a/src/test/java/numble/bankingapi/fake/FakeMemberRepository.java b/src/test/java/bankingapi/fake/FakeMemberRepository.java similarity index 88% rename from src/test/java/numble/bankingapi/fake/FakeMemberRepository.java rename to src/test/java/bankingapi/fake/FakeMemberRepository.java index 40b3630..165b2a3 100644 --- a/src/test/java/numble/bankingapi/fake/FakeMemberRepository.java +++ b/src/test/java/bankingapi/fake/FakeMemberRepository.java @@ -1,4 +1,4 @@ -package numble.bankingapi.fake; +package bankingapi.fake; import java.util.ArrayList; import java.util.HashMap; @@ -6,8 +6,8 @@ import java.util.Map; import java.util.Optional; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberRepository; public class FakeMemberRepository implements MemberRepository { diff --git a/src/test/java/numble/bankingapi/fixture/AccountFixture.java b/src/test/java/bankingapi/fixture/AccountFixture.java similarity index 72% rename from src/test/java/numble/bankingapi/fixture/AccountFixture.java rename to src/test/java/bankingapi/fixture/AccountFixture.java index e5a7711..038d1a1 100644 --- a/src/test/java/numble/bankingapi/fixture/AccountFixture.java +++ b/src/test/java/bankingapi/fixture/AccountFixture.java @@ -1,9 +1,9 @@ -package numble.bankingapi.fixture; +package bankingapi.fixture; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.HistoryType; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.HistoryType; +import bankingapi.banking.domain.Money; +import bankingapi.util.generator.AccountNumberGenerator; public class AccountFixture { public static final AccountNumber 계좌번호 = AccountNumberGenerator.generate(); diff --git a/src/test/java/numble/bankingapi/fixture/DocumentationFixture.java b/src/test/java/bankingapi/fixture/DocumentationFixture.java similarity index 51% rename from src/test/java/numble/bankingapi/fixture/DocumentationFixture.java rename to src/test/java/bankingapi/fixture/DocumentationFixture.java index 84f6792..7c0a451 100644 --- a/src/test/java/numble/bankingapi/fixture/DocumentationFixture.java +++ b/src/test/java/bankingapi/fixture/DocumentationFixture.java @@ -1,33 +1,31 @@ -package numble.bankingapi.fixture; - -import static numble.bankingapi.fixture.AccountFixture.*; +package bankingapi.fixture; import java.time.LocalDateTime; import java.util.List; -import numble.bankingapi.banking.domain.AccountNumber; -import numble.bankingapi.banking.domain.HistoryType; -import numble.bankingapi.banking.dto.HistoryResponse; -import numble.bankingapi.banking.dto.HistoryResponses; -import numble.bankingapi.banking.dto.TargetResponse; -import numble.bankingapi.banking.dto.TargetResponses; -import numble.bankingapi.util.generator.AccountNumberGenerator; +import bankingapi.banking.domain.AccountNumber; +import bankingapi.banking.domain.HistoryType; +import bankingapi.banking.dto.HistoryResponse; +import bankingapi.banking.dto.HistoryResponses; +import bankingapi.banking.dto.TargetResponse; +import bankingapi.banking.dto.TargetResponses; +import bankingapi.util.generator.AccountNumberGenerator; public class DocumentationFixture { public static final String 계좌_번호 = AccountNumberGenerator.generate().getNumber(); public static final HistoryResponses 계좌_내역 = new HistoryResponses( - 이만원, + AccountFixture.이만원, List.of( - new HistoryResponse(HistoryType.DEPOSIT, 이만원, new AccountNumber(계좌_번호), + new HistoryResponse(HistoryType.DEPOSIT, AccountFixture.이만원, new AccountNumber(계좌_번호), AccountNumberGenerator.generate(), LocalDateTime.of(2022, 2, 13, 12, 10)), - new HistoryResponse(HistoryType.WITHDRAW, 오천원, new AccountNumber(계좌_번호), + new HistoryResponse(HistoryType.WITHDRAW, AccountFixture.오천원, new AccountNumber(계좌_번호), AccountNumberGenerator.generate(), LocalDateTime.of(2022, 2, 3, 4, 10)), - new HistoryResponse(HistoryType.WITHDRAW, 만원, new AccountNumber(계좌_번호), + new HistoryResponse(HistoryType.WITHDRAW, AccountFixture.만원, new AccountNumber(계좌_번호), AccountNumberGenerator.generate(), LocalDateTime.of(2022, 2, 1, 21, 10)), - new HistoryResponse(HistoryType.DEPOSIT, 십만원, new AccountNumber(계좌_번호), + new HistoryResponse(HistoryType.DEPOSIT, AccountFixture.십만원, new AccountNumber(계좌_번호), AccountNumberGenerator.generate(), LocalDateTime.of(2022, 1, 21, 20, 10)), - new HistoryResponse(HistoryType.WITHDRAW, 만오천원, new AccountNumber(계좌_번호), + new HistoryResponse(HistoryType.WITHDRAW, AccountFixture.만오천원, new AccountNumber(계좌_번호), AccountNumberGenerator.generate(), LocalDateTime.of(2022, 1, 10, 8, 10)) )); diff --git a/src/test/java/numble/bankingapi/fixture/MemberFixture.java b/src/test/java/bankingapi/fixture/MemberFixture.java similarity index 84% rename from src/test/java/numble/bankingapi/fixture/MemberFixture.java rename to src/test/java/bankingapi/fixture/MemberFixture.java index d77d194..e89aa21 100644 --- a/src/test/java/numble/bankingapi/fixture/MemberFixture.java +++ b/src/test/java/bankingapi/fixture/MemberFixture.java @@ -1,4 +1,4 @@ -package numble.bankingapi.fixture; +package bankingapi.fixture; public class MemberFixture { diff --git a/src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java b/src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java similarity index 91% rename from src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java rename to src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java index 71a3034..9bcc795 100644 --- a/src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java +++ b/src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryServiceTest.java @@ -1,10 +1,13 @@ -package numble.bankingapi.idempotent.domain; +package bankingapi.idempotent.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import java.util.UUID; +import bankingapi.idempotent.domain.IdempotentRequestHistory; +import bankingapi.idempotent.domain.IdempotentRequestHistoryService; +import bankingapi.idempotent.domain.IdempotentRequestRepository; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java b/src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java similarity index 92% rename from src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java rename to src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java index bf244b3..49ea8be 100644 --- a/src/test/java/numble/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java +++ b/src/test/java/bankingapi/idempotent/domain/IdempotentRequestHistoryTest.java @@ -1,10 +1,11 @@ -package numble.bankingapi.idempotent.domain; +package bankingapi.idempotent.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import java.util.UUID; +import bankingapi.idempotent.domain.IdempotentRequestHistory; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/numble/bankingapi/member/application/CustomUserDetailServiceTest.java b/src/test/java/bankingapi/member/application/CustomUserDetailServiceTest.java similarity index 85% rename from src/test/java/numble/bankingapi/member/application/CustomUserDetailServiceTest.java rename to src/test/java/bankingapi/member/application/CustomUserDetailServiceTest.java index 74f2ba9..826c017 100644 --- a/src/test/java/numble/bankingapi/member/application/CustomUserDetailServiceTest.java +++ b/src/test/java/bankingapi/member/application/CustomUserDetailServiceTest.java @@ -1,6 +1,6 @@ -package numble.bankingapi.member.application; +package bankingapi.member.application; -import static numble.bankingapi.fixture.MemberFixture.*; +import static bankingapi.fixture.MemberFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -13,9 +13,9 @@ import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.transaction.annotation.Transactional; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.member.exception.NotExistMemberException; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberRepository; +import bankingapi.member.exception.NotExistMemberException; @Transactional @SpringBootTest diff --git a/src/test/java/numble/bankingapi/member/application/MemberApplicationServiceTest.java b/src/test/java/bankingapi/member/application/MemberApplicationServiceTest.java similarity index 85% rename from src/test/java/numble/bankingapi/member/application/MemberApplicationServiceTest.java rename to src/test/java/bankingapi/member/application/MemberApplicationServiceTest.java index 375db64..c3182d4 100644 --- a/src/test/java/numble/bankingapi/member/application/MemberApplicationServiceTest.java +++ b/src/test/java/bankingapi/member/application/MemberApplicationServiceTest.java @@ -1,6 +1,6 @@ -package numble.bankingapi.member.application; +package bankingapi.member.application; -import static numble.bankingapi.fixture.MemberFixture.*; +import static bankingapi.fixture.MemberFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -11,17 +11,17 @@ import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.transaction.annotation.Transactional; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; -import numble.bankingapi.member.dto.RegisterCommand; -import numble.bankingapi.member.exception.NotExistMemberException; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberRepository; +import bankingapi.member.dto.RegisterCommand; +import bankingapi.member.exception.NotExistMemberException; @Transactional @SpringBootTest class MemberApplicationServiceTest { @Autowired - MemberApplicationService memberApplicationService; + MemberApplicationService memberApplicationService; @Autowired MemberRepository memberRepository; diff --git a/src/test/java/numble/bankingapi/member/domain/MemberTest.java b/src/test/java/bankingapi/member/domain/MemberTest.java similarity index 92% rename from src/test/java/numble/bankingapi/member/domain/MemberTest.java rename to src/test/java/bankingapi/member/domain/MemberTest.java index 8bd7e13..e3e8e31 100644 --- a/src/test/java/numble/bankingapi/member/domain/MemberTest.java +++ b/src/test/java/bankingapi/member/domain/MemberTest.java @@ -1,6 +1,6 @@ -package numble.bankingapi.member.domain; +package bankingapi.member.domain; -import static numble.bankingapi.fixture.MemberFixture.*; +import static bankingapi.fixture.MemberFixture.*; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -9,7 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.NullAndEmptySource; -import numble.bankingapi.member.exception.InvalidFormatException; +import bankingapi.member.exception.InvalidFormatException; class MemberTest { diff --git a/src/test/java/numble/bankingapi/social/domain/AskedFriendHistoryTest.java b/src/test/java/bankingapi/social/domain/AskedFriendHistoryTest.java similarity index 96% rename from src/test/java/numble/bankingapi/social/domain/AskedFriendHistoryTest.java rename to src/test/java/bankingapi/social/domain/AskedFriendHistoryTest.java index 6451ac5..562c135 100644 --- a/src/test/java/numble/bankingapi/social/domain/AskedFriendHistoryTest.java +++ b/src/test/java/bankingapi/social/domain/AskedFriendHistoryTest.java @@ -1,8 +1,10 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.social.domain.ApprovalStatus; +import bankingapi.social.domain.AskedFriendHistory; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/numble/bankingapi/social/domain/FriendServiceTest.java b/src/test/java/bankingapi/social/domain/FriendServiceTest.java similarity index 97% rename from src/test/java/numble/bankingapi/social/domain/FriendServiceTest.java rename to src/test/java/bankingapi/social/domain/FriendServiceTest.java index 84a741c..f7d6812 100644 --- a/src/test/java/numble/bankingapi/social/domain/FriendServiceTest.java +++ b/src/test/java/bankingapi/social/domain/FriendServiceTest.java @@ -1,8 +1,9 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.social.domain.*; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/numble/bankingapi/social/domain/FriendTest.java b/src/test/java/bankingapi/social/domain/FriendTest.java similarity index 94% rename from src/test/java/numble/bankingapi/social/domain/FriendTest.java rename to src/test/java/bankingapi/social/domain/FriendTest.java index 47d5682..08b9e80 100644 --- a/src/test/java/numble/bankingapi/social/domain/FriendTest.java +++ b/src/test/java/bankingapi/social/domain/FriendTest.java @@ -1,8 +1,9 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.social.domain.Friend; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/numble/bankingapi/social/domain/SocialNetworkServiceTest.java b/src/test/java/bankingapi/social/domain/SocialNetworkServiceTest.java similarity index 98% rename from src/test/java/numble/bankingapi/social/domain/SocialNetworkServiceTest.java rename to src/test/java/bankingapi/social/domain/SocialNetworkServiceTest.java index 35c2670..e267350 100644 --- a/src/test/java/numble/bankingapi/social/domain/SocialNetworkServiceTest.java +++ b/src/test/java/bankingapi/social/domain/SocialNetworkServiceTest.java @@ -1,8 +1,9 @@ -package numble.bankingapi.social.domain; +package bankingapi.social.domain; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.social.domain.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -10,8 +11,8 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.transaction.annotation.Transactional; -import numble.bankingapi.member.domain.Member; -import numble.bankingapi.member.domain.MemberRepository; +import bankingapi.member.domain.Member; +import bankingapi.member.domain.MemberRepository; @Transactional @SpringBootTest diff --git a/src/test/java/numble/bankingapi/util/DatabaseCleanup.java b/src/test/java/bankingapi/util/DatabaseCleanup.java similarity index 97% rename from src/test/java/numble/bankingapi/util/DatabaseCleanup.java rename to src/test/java/bankingapi/util/DatabaseCleanup.java index 7604441..2441c99 100644 --- a/src/test/java/numble/bankingapi/util/DatabaseCleanup.java +++ b/src/test/java/bankingapi/util/DatabaseCleanup.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util; +package bankingapi.util; import static org.testcontainers.shaded.com.google.common.base.CaseFormat.*; diff --git a/src/test/java/numble/bankingapi/util/WithMockMember.java b/src/test/java/bankingapi/util/WithMockMember.java similarity index 92% rename from src/test/java/numble/bankingapi/util/WithMockMember.java rename to src/test/java/bankingapi/util/WithMockMember.java index f710544..69ba2f7 100644 --- a/src/test/java/numble/bankingapi/util/WithMockMember.java +++ b/src/test/java/bankingapi/util/WithMockMember.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util; +package bankingapi.util; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; diff --git a/src/test/java/numble/bankingapi/util/WithMockUserSecurityContextFactory.java b/src/test/java/bankingapi/util/WithMockUserSecurityContextFactory.java similarity index 96% rename from src/test/java/numble/bankingapi/util/WithMockUserSecurityContextFactory.java rename to src/test/java/bankingapi/util/WithMockUserSecurityContextFactory.java index d7802c0..a32422d 100644 --- a/src/test/java/numble/bankingapi/util/WithMockUserSecurityContextFactory.java +++ b/src/test/java/bankingapi/util/WithMockUserSecurityContextFactory.java @@ -1,4 +1,4 @@ -package numble.bankingapi.util; +package bankingapi.util; import java.util.List; diff --git a/src/test/java/numble/bankingapi/util/filter/IdempotentRequestInterceptorTest.java b/src/test/java/bankingapi/util/filter/IdempotentRequestInterceptorTest.java similarity index 92% rename from src/test/java/numble/bankingapi/util/filter/IdempotentRequestInterceptorTest.java rename to src/test/java/bankingapi/util/filter/IdempotentRequestInterceptorTest.java index 01eb798..ed18585 100644 --- a/src/test/java/numble/bankingapi/util/filter/IdempotentRequestInterceptorTest.java +++ b/src/test/java/bankingapi/util/filter/IdempotentRequestInterceptorTest.java @@ -1,9 +1,10 @@ -package numble.bankingapi.util.filter; +package bankingapi.util.filter; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; +import bankingapi.util.filter.IdempotentRequestInterceptor; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -19,11 +20,11 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import numble.bankingapi.banking.domain.Money; -import numble.bankingapi.banking.dto.TransferCommand; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistory; -import numble.bankingapi.idempotent.domain.IdempotentRequestHistoryService; -import numble.bankingapi.idempotent.exception.InvalidIdempotencyKey; +import bankingapi.banking.domain.Money; +import bankingapi.banking.dto.TransferCommand; +import bankingapi.idempotent.domain.IdempotentRequestHistory; +import bankingapi.idempotent.domain.IdempotentRequestHistoryService; +import bankingapi.idempotent.exception.InvalidIdempotencyKey; @ExtendWith(MockitoExtension.class) class IdempotentRequestInterceptorTest { diff --git a/src/test/java/numble/bankingapi/util/filter/PathMatcherInterceptorTest.java b/src/test/java/bankingapi/util/filter/PathMatcherInterceptorTest.java similarity index 94% rename from src/test/java/numble/bankingapi/util/filter/PathMatcherInterceptorTest.java rename to src/test/java/bankingapi/util/filter/PathMatcherInterceptorTest.java index ce35e42..eb18841 100644 --- a/src/test/java/numble/bankingapi/util/filter/PathMatcherInterceptorTest.java +++ b/src/test/java/bankingapi/util/filter/PathMatcherInterceptorTest.java @@ -1,9 +1,10 @@ -package numble.bankingapi.util.filter; +package bankingapi.util.filter; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; +import bankingapi.util.filter.PathMatcherInterceptor; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -16,7 +17,7 @@ import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.web.servlet.HandlerInterceptor; -import numble.bankingapi.util.matcher.CustomPathContainer; +import bankingapi.util.matcher.CustomPathContainer; @ExtendWith(MockitoExtension.class) class PathMatcherInterceptorTest { diff --git a/src/test/java/numble/bankingapi/util/generator/AccountNumberGeneratorTest.java b/src/test/java/bankingapi/util/generator/AccountNumberGeneratorTest.java similarity index 90% rename from src/test/java/numble/bankingapi/util/generator/AccountNumberGeneratorTest.java rename to src/test/java/bankingapi/util/generator/AccountNumberGeneratorTest.java index 9834540..530a34f 100644 --- a/src/test/java/numble/bankingapi/util/generator/AccountNumberGeneratorTest.java +++ b/src/test/java/bankingapi/util/generator/AccountNumberGeneratorTest.java @@ -1,10 +1,11 @@ -package numble.bankingapi.util.generator; +package bankingapi.util.generator; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; import java.util.random.RandomGenerator; +import bankingapi.util.generator.AccountNumberGenerator; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.RepeatedTest; diff --git a/src/test/java/numble/bankingapi/util/matcher/CustomPathContainerTest.java b/src/test/java/bankingapi/util/matcher/CustomPathContainerTest.java similarity index 95% rename from src/test/java/numble/bankingapi/util/matcher/CustomPathContainerTest.java rename to src/test/java/bankingapi/util/matcher/CustomPathContainerTest.java index 4a83ee0..d8be669 100644 --- a/src/test/java/numble/bankingapi/util/matcher/CustomPathContainerTest.java +++ b/src/test/java/bankingapi/util/matcher/CustomPathContainerTest.java @@ -1,8 +1,9 @@ -package numble.bankingapi.util.matcher; +package bankingapi.util.matcher; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import bankingapi.util.matcher.CustomPathContainer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test;