From 360f4a686f2c1bbdfc7e5d6333488a4405c3f4eb Mon Sep 17 00:00:00 2001 From: Ohzzi Date: Fri, 4 Nov 2022 10:26:04 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20core=EC=99=80=20external-api?= =?UTF-8?q?=EB=A1=9C=20=EB=AA=A8=EB=93=88=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 41 ++++++++++++------- kitchenpos-core/build.gradle | 13 ++++++ .../domain/common/NumberOfGuests.java | 0 .../kitchenpos/domain/common/OrderStatus.java | 0 .../java/kitchenpos/domain/common/Price.java | 0 .../kitchenpos/domain/common/Quantity.java | 0 .../java/kitchenpos/domain/menu/Menu.java | 0 .../kitchenpos/domain/menu/MenuGroup.java | 0 .../domain/menu/MenuGroupRepository.java | 1 - .../kitchenpos/domain/menu/MenuProduct.java | 0 .../domain/menu/MenuRepository.java | 1 - .../java/kitchenpos/domain/order/Order.java | 4 +- .../domain/order/OrderLineItem.java | 0 .../domain/order/OrderRepository.java | 0 .../kitchenpos/domain/order/OrderedMenu.java | 0 .../kitchenpos/domain/product/Product.java | 0 .../domain/product/ProductRepository.java | 0 .../domain/table/OrderStatusRecord.java | 4 +- .../table/OrderStatusRecordRepository.java | 0 .../kitchenpos/domain/table/OrderTable.java | 0 .../domain/table/OrderTableRepository.java | 1 - .../kitchenpos/domain/table/TableGroup.java | 0 .../domain/table/TableGroupRepository.java | 1 - .../exception/ApplicationException.java | 0 .../badrequest/AlreadyGroupedException.java | 0 .../badrequest/BadRequestException.java | 0 .../CompletedOrderCannotChangeException.java | 0 ...lOrderTableCannotChangeEmptyException.java | 0 ...ealOrderTableCannotUngroupedException.java | 0 .../DuplicateOrderLineItemException.java | 0 ...leCannotChangeNumberOfGuestsException.java | 0 .../ExpensiveMenuPriceException.java | 0 ...roupedTableCannotChangeEmptyException.java | 0 .../InvalidOrderTableSizeException.java | 0 .../MenuGroupNotExistsException.java | 0 .../badrequest/MenuNotExistsException.java | 0 .../NegativeNumberOfGuestsException.java | 0 .../badrequest/NegativePriceException.java | 0 .../NotPositiveQuantityException.java | 0 .../OrderLineItemNotExistsException.java | 0 .../badrequest/OrderNotExistsException.java | 0 .../badrequest/OrderTableEmptyException.java | 0 .../OrderTableNotEmptyException.java | 0 .../OrderTableNotExistsException.java | 0 .../badrequest/ProductNotExistsException.java | 0 .../TableGroupNotExistsException.java | 0 .../kitchenpos/KitchenPosCoreApplication.java | 12 ++++++ .../test/java/kitchenpos/RepositoryTest.java | 0 .../domain/common/NumberOfGuestsTest.java | 5 +-- .../kitchenpos/domain/common/PriceTest.java | 0 .../domain/common/QuantityTest.java | 0 .../domain/menu/MenuGroupRepositoryTest.java | 0 .../domain/menu/MenuProductTest.java | 0 .../domain/menu/MenuRepositoryTest.java | 0 .../java/kitchenpos/domain/menu/MenuTest.java | 0 .../domain/order/OrderRepositoryTest.java | 0 .../kitchenpos/domain/order/OrderTest.java | 0 .../domain/product/ProductRepositoryTest.java | 0 .../domain/table/OrderStatusRecordTest.java | 0 .../table/OrderTableRepositoryTest.java | 0 .../domain/table/OrderTableTest.java | 0 .../table/TableGroupRepositoryTest.java | 0 .../domain/table/TableGroupTest.java | 0 kitchenpos-external-api/build.gradle | 16 ++++++++ .../main/java/kitchenpos/Application.java | 0 .../application/menu/MenuGroupService.java | 0 .../application/menu/MenuService.java | 0 .../application/order/OrderService.java | 0 .../application/product/ProductService.java | 0 .../application/table/TableGroupService.java | 0 .../application/table/TableService.java | 0 .../dto/common/response/ErrorResponse.java | 0 .../dto/menu/mapper/MenuDtoMapper.java | 0 .../dto/menu/mapper/MenuDtoMapperImpl.java | 0 .../dto/menu/mapper/MenuGroupDtoMapper.java | 0 .../menu/mapper/MenuGroupDtoMapperImpl.java | 0 .../dto/menu/mapper/MenuGroupMapper.java | 0 .../dto/menu/mapper/MenuGroupMapperImpl.java | 0 .../dto/menu/mapper/MenuMapper.java | 0 .../dto/menu/mapper/MenuMapperImpl.java | 0 .../dto/menu/request/MenuCreateRequest.java | 0 .../menu/request/MenuGroupCreateRequest.java | 0 .../request/MenuProductCreateRequest.java | 0 .../dto/menu/response/MenuGroupResponse.java | 0 .../menu/response/MenuProductResponse.java | 0 .../dto/menu/response/MenuResponse.java | 0 .../dto/order/mapper/OrderDtoMapper.java | 0 .../dto/order/mapper/OrderDtoMapperImpl.java | 0 .../dto/order/mapper/OrderLineItemMapper.java | 0 .../order/mapper/OrderLineItemMapperImpl.java | 0 .../dto/order/mapper/OrderMapper.java | 0 .../dto/order/mapper/OrderMapperImpl.java | 0 .../dto/order/request/OrderCreateRequest.java | 0 .../request/OrderLineItemCreateRequest.java | 0 .../request/OrderStatusChangeRequest.java | 0 .../order/response/OrderLineItemResponse.java | 0 .../dto/order/response/OrderResponse.java | 0 .../dto/product/mapper/ProductDtoMapper.java | 0 .../product/mapper/ProductDtoMapperImpl.java | 0 .../dto/product/mapper/ProductMapper.java | 0 .../dto/product/mapper/ProductMapperImpl.java | 0 .../product/request/ProductCreateRequest.java | 0 .../dto/product/response/ProductResponse.java | 0 .../dto/table/mapper/OrderTableDtoMapper.java | 0 .../table/mapper/OrderTableDtoMapperImpl.java | 0 .../dto/table/mapper/OrderTableMapper.java | 0 .../table/mapper/OrderTableMapperImpl.java | 0 .../dto/table/mapper/TableGroupDtoMapper.java | 0 .../table/mapper/TableGroupDtoMapperImpl.java | 0 .../request/NumberOfGuestsChangeRequest.java | 0 .../request/OrderTableCreateRequest.java | 0 .../table/request/OrderTableIdRequest.java | 0 .../request/TableEmptyChangeRequest.java | 0 .../request/TableGroupCreateRequest.java | 0 .../table/response/OrderTableResponse.java | 0 .../table/response/TableGroupResponse.java | 0 .../ui/common/GlobalControllerAdvice.java | 0 .../ui/menu/MenuGroupRestController.java | 0 .../ui/menu/MenuRestController.java | 0 .../ui/order/OrderRestController.java | 0 .../ui/product/ProductRestController.java | 0 .../ui/table/TableGroupRestController.java | 0 .../ui/table/TableRestController.java | 0 .../src}/main/resources/application.yml | 0 .../V1__Initialize_project_tables.sql | 0 .../db/migration/V2__Insert_default_data.sql | 0 .../migration/V3__Add_MenuProduct_price.sql | 0 .../db/migration/V4__Add_Ordered_Menu.sql | 0 .../migration/V5__ADD_OrderStatusRecord.sql | 0 .../src}/main/resources/static/empty.txt | 0 .../src}/main/resources/templates/empty.txt | 0 .../test/java/kitchenpos/ApplicationTest.java | 0 .../test/java/kitchenpos/ServiceTest.java | 0 .../menu/MenuGroupServiceTest.java | 3 +- .../application/menu/MenuServiceTest.java | 3 +- .../application/order/OrderServiceTest.java | 5 ++- .../product/ProductServiceTest.java | 3 +- .../table/TableGroupServiceTest.java | 0 .../application/table/TableServiceTest.java | 3 +- .../ui/menu/MenuGroupRestControllerTest.java | 4 +- .../ui/menu/MenuRestControllerTest.java | 4 +- .../ui/order/OrderRestControllerTest.java | 3 +- .../ui/product/ProductRestControllerTest.java | 4 +- .../ui/product/RestControllerTest.java | 1 - .../table/TableGroupRestControllerTest.java | 0 .../ui/table/TableRestControllerTest.java | 3 +- .../src}/test/resources/application.yml | 0 .../src}/test/resources/schema.sql | 0 settings.gradle | 5 +++ 149 files changed, 98 insertions(+), 42 deletions(-) create mode 100644 kitchenpos-core/build.gradle rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/common/NumberOfGuests.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/common/OrderStatus.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/common/Price.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/common/Quantity.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/menu/Menu.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/menu/MenuGroup.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/menu/MenuGroupRepository.java (81%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/menu/MenuProduct.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/menu/MenuRepository.java (86%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/order/Order.java (97%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/order/OrderLineItem.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/order/OrderRepository.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/order/OrderedMenu.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/product/Product.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/product/ProductRepository.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/OrderStatusRecord.java (95%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/OrderStatusRecordRepository.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/OrderTable.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/OrderTableRepository.java (91%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/TableGroup.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/domain/table/TableGroupRepository.java (80%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/ApplicationException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/AlreadyGroupedException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/BadRequestException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/CompletedOrderCannotChangeException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotChangeEmptyException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotUngroupedException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/EmptyTableCannotChangeNumberOfGuestsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/ExpensiveMenuPriceException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/GroupedTableCannotChangeEmptyException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/InvalidOrderTableSizeException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/NegativeNumberOfGuestsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/NegativePriceException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/NotPositiveQuantityException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/OrderLineItemNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/OrderTableEmptyException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/OrderTableNotEmptyException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java (100%) rename {src => kitchenpos-core/src}/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java (100%) create mode 100644 kitchenpos-core/src/test/java/kitchenpos/KitchenPosCoreApplication.java rename {src => kitchenpos-core/src}/test/java/kitchenpos/RepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java (57%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/common/PriceTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/common/QuantityTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/menu/MenuGroupRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/menu/MenuProductTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/menu/MenuRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/menu/MenuTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/order/OrderRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/order/OrderTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/product/ProductRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/table/OrderStatusRecordTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/table/OrderTableRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/table/OrderTableTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/table/TableGroupRepositoryTest.java (100%) rename {src => kitchenpos-core/src}/test/java/kitchenpos/domain/table/TableGroupTest.java (100%) create mode 100644 kitchenpos-external-api/build.gradle rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/Application.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/menu/MenuGroupService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/menu/MenuService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/order/OrderService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/product/ProductService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/table/TableGroupService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/application/table/TableService.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/common/response/ErrorResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/mapper/MenuMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/request/MenuCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/request/MenuGroupCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/request/MenuProductCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/response/MenuGroupResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/response/MenuProductResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/menu/response/MenuResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/mapper/OrderMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/request/OrderCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/request/OrderLineItemCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/request/OrderStatusChangeRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/response/OrderLineItemResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/order/response/OrderResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/mapper/ProductDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/mapper/ProductDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/mapper/ProductMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/mapper/ProductMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/request/ProductCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/product/response/ProductResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/OrderTableMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/OrderTableMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapper.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapperImpl.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/request/NumberOfGuestsChangeRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/request/OrderTableCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/request/OrderTableIdRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/request/TableEmptyChangeRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/request/TableGroupCreateRequest.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/response/OrderTableResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/dto/table/response/TableGroupResponse.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/menu/MenuGroupRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/menu/MenuRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/order/OrderRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/product/ProductRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/table/TableGroupRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/java/kitchenpos/ui/table/TableRestController.java (100%) rename {src => kitchenpos-external-api/src}/main/resources/application.yml (100%) rename {src => kitchenpos-external-api/src}/main/resources/db/migration/V1__Initialize_project_tables.sql (100%) rename {src => kitchenpos-external-api/src}/main/resources/db/migration/V2__Insert_default_data.sql (100%) rename {src => kitchenpos-external-api/src}/main/resources/db/migration/V3__Add_MenuProduct_price.sql (100%) rename {src => kitchenpos-external-api/src}/main/resources/db/migration/V4__Add_Ordered_Menu.sql (100%) rename {src => kitchenpos-external-api/src}/main/resources/db/migration/V5__ADD_OrderStatusRecord.sql (100%) rename {src => kitchenpos-external-api/src}/main/resources/static/empty.txt (100%) rename {src => kitchenpos-external-api/src}/main/resources/templates/empty.txt (100%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ApplicationTest.java (100%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ServiceTest.java (100%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java (94%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/menu/MenuServiceTest.java (97%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/order/OrderServiceTest.java (98%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/product/ProductServiceTest.java (92%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/table/TableGroupServiceTest.java (100%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/application/table/TableServiceTest.java (96%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java (95%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java (98%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/order/OrderRestControllerTest.java (98%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/product/ProductRestControllerTest.java (96%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/product/RestControllerTest.java (96%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/table/TableGroupRestControllerTest.java (100%) rename {src => kitchenpos-external-api/src}/test/java/kitchenpos/ui/table/TableRestControllerTest.java (98%) rename {src => kitchenpos-external-api/src}/test/resources/application.yml (100%) rename {src => kitchenpos-external-api/src}/test/resources/schema.sql (100%) diff --git a/build.gradle b/build.gradle index dc08e8de53..ab58ebdf3a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,25 +4,38 @@ plugins { id 'java' } -group = 'camp.nextstep.edu' -version = '0.0.1-SNAPSHOT' -sourceCompatibility = '1.11' +subprojects { + apply plugin: 'java' + apply plugin: 'org.springframework.boot' + apply plugin: 'io.spring.dependency-management' -repositories { - mavenCentral() -} + group = 'camp.nextstep.edu' + version = '0.0.1-SNAPSHOT' + sourceCompatibility = '11' + + repositories { + mavenCentral() + } + + dependencies { + testImplementation('org.springframework.boot:spring-boot-starter-test') { + exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + } + } -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-actuator' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.flywaydb:flyway-core' - runtimeOnly 'com.h2database:h2' - testImplementation('org.springframework.boot:spring-boot-starter-test') { - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' + test { + useJUnitPlatform() } } test { useJUnitPlatform() } + +bootJar { + enabled = false +} + +jar { + enabled = true +} diff --git a/kitchenpos-core/build.gradle b/kitchenpos-core/build.gradle new file mode 100644 index 0000000000..6b17bf366f --- /dev/null +++ b/kitchenpos-core/build.gradle @@ -0,0 +1,13 @@ +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + testRuntimeOnly 'com.h2database:h2' +} + +bootJar { + enabled = false +} + +jar { + enabled true +} diff --git a/src/main/java/kitchenpos/domain/common/NumberOfGuests.java b/kitchenpos-core/src/main/java/kitchenpos/domain/common/NumberOfGuests.java similarity index 100% rename from src/main/java/kitchenpos/domain/common/NumberOfGuests.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/common/NumberOfGuests.java diff --git a/src/main/java/kitchenpos/domain/common/OrderStatus.java b/kitchenpos-core/src/main/java/kitchenpos/domain/common/OrderStatus.java similarity index 100% rename from src/main/java/kitchenpos/domain/common/OrderStatus.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/common/OrderStatus.java diff --git a/src/main/java/kitchenpos/domain/common/Price.java b/kitchenpos-core/src/main/java/kitchenpos/domain/common/Price.java similarity index 100% rename from src/main/java/kitchenpos/domain/common/Price.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/common/Price.java diff --git a/src/main/java/kitchenpos/domain/common/Quantity.java b/kitchenpos-core/src/main/java/kitchenpos/domain/common/Quantity.java similarity index 100% rename from src/main/java/kitchenpos/domain/common/Quantity.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/common/Quantity.java diff --git a/src/main/java/kitchenpos/domain/menu/Menu.java b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/Menu.java similarity index 100% rename from src/main/java/kitchenpos/domain/menu/Menu.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/menu/Menu.java diff --git a/src/main/java/kitchenpos/domain/menu/MenuGroup.java b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuGroup.java similarity index 100% rename from src/main/java/kitchenpos/domain/menu/MenuGroup.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuGroup.java diff --git a/src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java similarity index 81% rename from src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java index f9c9607f0c..3bb0fc2dd1 100644 --- a/src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuGroupRepository.java @@ -1,6 +1,5 @@ package kitchenpos.domain.menu; -import kitchenpos.domain.menu.MenuGroup; import org.springframework.data.jpa.repository.JpaRepository; public interface MenuGroupRepository extends JpaRepository { diff --git a/src/main/java/kitchenpos/domain/menu/MenuProduct.java b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuProduct.java similarity index 100% rename from src/main/java/kitchenpos/domain/menu/MenuProduct.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuProduct.java diff --git a/src/main/java/kitchenpos/domain/menu/MenuRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuRepository.java similarity index 86% rename from src/main/java/kitchenpos/domain/menu/MenuRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuRepository.java index be945421af..3131ba8f62 100644 --- a/src/main/java/kitchenpos/domain/menu/MenuRepository.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/menu/MenuRepository.java @@ -1,7 +1,6 @@ package kitchenpos.domain.menu; import java.util.List; -import kitchenpos.domain.menu.Menu; import org.springframework.data.jpa.repository.JpaRepository; public interface MenuRepository extends JpaRepository { diff --git a/src/main/java/kitchenpos/domain/order/Order.java b/kitchenpos-core/src/main/java/kitchenpos/domain/order/Order.java similarity index 97% rename from src/main/java/kitchenpos/domain/order/Order.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/order/Order.java index ccf9703eb2..fa302cd713 100644 --- a/src/main/java/kitchenpos/domain/order/Order.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/order/Order.java @@ -1,7 +1,5 @@ package kitchenpos.domain.order; -import static kitchenpos.domain.common.OrderStatus.COMPLETION; - import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -84,7 +82,7 @@ public void changeOrderStatus(final String orderStatusName) { } private void validateNotCompleted() { - if (orderStatus == COMPLETION) { + if (orderStatus == OrderStatus.COMPLETION) { throw new CompletedOrderCannotChangeException(); } } diff --git a/src/main/java/kitchenpos/domain/order/OrderLineItem.java b/kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderLineItem.java similarity index 100% rename from src/main/java/kitchenpos/domain/order/OrderLineItem.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderLineItem.java diff --git a/src/main/java/kitchenpos/domain/order/OrderRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderRepository.java similarity index 100% rename from src/main/java/kitchenpos/domain/order/OrderRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderRepository.java diff --git a/src/main/java/kitchenpos/domain/order/OrderedMenu.java b/kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderedMenu.java similarity index 100% rename from src/main/java/kitchenpos/domain/order/OrderedMenu.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/order/OrderedMenu.java diff --git a/src/main/java/kitchenpos/domain/product/Product.java b/kitchenpos-core/src/main/java/kitchenpos/domain/product/Product.java similarity index 100% rename from src/main/java/kitchenpos/domain/product/Product.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/product/Product.java diff --git a/src/main/java/kitchenpos/domain/product/ProductRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/product/ProductRepository.java similarity index 100% rename from src/main/java/kitchenpos/domain/product/ProductRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/product/ProductRepository.java diff --git a/src/main/java/kitchenpos/domain/table/OrderStatusRecord.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderStatusRecord.java similarity index 95% rename from src/main/java/kitchenpos/domain/table/OrderStatusRecord.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderStatusRecord.java index d339c71925..5318868f2f 100644 --- a/src/main/java/kitchenpos/domain/table/OrderStatusRecord.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderStatusRecord.java @@ -1,7 +1,5 @@ package kitchenpos.domain.table; -import static kitchenpos.domain.common.OrderStatus.COMPLETION; - import java.util.Objects; import javax.persistence.Column; import javax.persistence.Entity; @@ -50,7 +48,7 @@ public void changeOrderStatus(final String orderStatusName) { } private void validateNotCompleted() { - if (orderStatus == COMPLETION) { + if (orderStatus == OrderStatus.COMPLETION) { throw new CompletedOrderCannotChangeException(); } } diff --git a/src/main/java/kitchenpos/domain/table/OrderStatusRecordRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderStatusRecordRepository.java similarity index 100% rename from src/main/java/kitchenpos/domain/table/OrderStatusRecordRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderStatusRecordRepository.java diff --git a/src/main/java/kitchenpos/domain/table/OrderTable.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java similarity index 100% rename from src/main/java/kitchenpos/domain/table/OrderTable.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java diff --git a/src/main/java/kitchenpos/domain/table/OrderTableRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTableRepository.java similarity index 91% rename from src/main/java/kitchenpos/domain/table/OrderTableRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTableRepository.java index ab19ff1c28..b09d693796 100644 --- a/src/main/java/kitchenpos/domain/table/OrderTableRepository.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTableRepository.java @@ -1,7 +1,6 @@ package kitchenpos.domain.table; import java.util.List; -import kitchenpos.domain.table.OrderTable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; diff --git a/src/main/java/kitchenpos/domain/table/TableGroup.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/TableGroup.java similarity index 100% rename from src/main/java/kitchenpos/domain/table/TableGroup.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/TableGroup.java diff --git a/src/main/java/kitchenpos/domain/table/TableGroupRepository.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/TableGroupRepository.java similarity index 80% rename from src/main/java/kitchenpos/domain/table/TableGroupRepository.java rename to kitchenpos-core/src/main/java/kitchenpos/domain/table/TableGroupRepository.java index 6f84f92161..6163e62f1c 100644 --- a/src/main/java/kitchenpos/domain/table/TableGroupRepository.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/table/TableGroupRepository.java @@ -1,6 +1,5 @@ package kitchenpos.domain.table; -import kitchenpos.domain.table.TableGroup; import org.springframework.data.jpa.repository.JpaRepository; public interface TableGroupRepository extends JpaRepository { diff --git a/src/main/java/kitchenpos/exception/ApplicationException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java similarity index 100% rename from src/main/java/kitchenpos/exception/ApplicationException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/AlreadyGroupedException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/AlreadyGroupedException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/AlreadyGroupedException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/AlreadyGroupedException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/BadRequestException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/CompletedOrderCannotChangeException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CompletedOrderCannotChangeException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/CompletedOrderCannotChangeException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CompletedOrderCannotChangeException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotChangeEmptyException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotChangeEmptyException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotChangeEmptyException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotChangeEmptyException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotUngroupedException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotUngroupedException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotUngroupedException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/CookingOrMealOrderTableCannotUngroupedException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/EmptyTableCannotChangeNumberOfGuestsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/EmptyTableCannotChangeNumberOfGuestsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/EmptyTableCannotChangeNumberOfGuestsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/EmptyTableCannotChangeNumberOfGuestsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/ExpensiveMenuPriceException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ExpensiveMenuPriceException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/ExpensiveMenuPriceException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ExpensiveMenuPriceException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/GroupedTableCannotChangeEmptyException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/GroupedTableCannotChangeEmptyException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/GroupedTableCannotChangeEmptyException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/GroupedTableCannotChangeEmptyException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/InvalidOrderTableSizeException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/InvalidOrderTableSizeException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/InvalidOrderTableSizeException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/InvalidOrderTableSizeException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/NegativeNumberOfGuestsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NegativeNumberOfGuestsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/NegativeNumberOfGuestsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NegativeNumberOfGuestsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/NegativePriceException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NegativePriceException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/NegativePriceException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NegativePriceException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/NotPositiveQuantityException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NotPositiveQuantityException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/NotPositiveQuantityException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/NotPositiveQuantityException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/OrderLineItemNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderLineItemNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/OrderLineItemNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderLineItemNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/OrderTableEmptyException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableEmptyException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/OrderTableEmptyException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableEmptyException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/OrderTableNotEmptyException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotEmptyException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/OrderTableNotEmptyException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotEmptyException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java diff --git a/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java similarity index 100% rename from src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java rename to kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java diff --git a/kitchenpos-core/src/test/java/kitchenpos/KitchenPosCoreApplication.java b/kitchenpos-core/src/test/java/kitchenpos/KitchenPosCoreApplication.java new file mode 100644 index 0000000000..396c1e5c48 --- /dev/null +++ b/kitchenpos-core/src/test/java/kitchenpos/KitchenPosCoreApplication.java @@ -0,0 +1,12 @@ +package kitchenpos; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class KitchenPosCoreApplication { + + public static void main(String[] args) { + SpringApplication.run(KitchenPosCoreApplication.class); + } +} diff --git a/src/test/java/kitchenpos/RepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/RepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/RepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/RepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java similarity index 57% rename from src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java index 4b522798c6..af7f0e3a56 100644 --- a/src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java +++ b/kitchenpos-core/src/test/java/kitchenpos/domain/common/NumberOfGuestsTest.java @@ -1,14 +1,13 @@ package kitchenpos.domain.common; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - import kitchenpos.exception.badrequest.NegativeNumberOfGuestsException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; class NumberOfGuestsTest { @Test void 인원_수는_음수일_수_없다() { - assertThatThrownBy(() -> new NumberOfGuests(-1)).isInstanceOf(NegativeNumberOfGuestsException.class); + Assertions.assertThatThrownBy(() -> new NumberOfGuests(-1)).isInstanceOf(NegativeNumberOfGuestsException.class); } } diff --git a/src/test/java/kitchenpos/domain/common/PriceTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/common/PriceTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/common/PriceTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/common/PriceTest.java diff --git a/src/test/java/kitchenpos/domain/common/QuantityTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/common/QuantityTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/common/QuantityTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/common/QuantityTest.java diff --git a/src/test/java/kitchenpos/domain/menu/MenuGroupRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuGroupRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/menu/MenuGroupRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuGroupRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/menu/MenuProductTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuProductTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/menu/MenuProductTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuProductTest.java diff --git a/src/test/java/kitchenpos/domain/menu/MenuRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/menu/MenuRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/menu/MenuTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/menu/MenuTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/menu/MenuTest.java diff --git a/src/test/java/kitchenpos/domain/order/OrderRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/order/OrderRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/order/OrderRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/order/OrderRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/order/OrderTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/order/OrderTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/order/OrderTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/order/OrderTest.java diff --git a/src/test/java/kitchenpos/domain/product/ProductRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/product/ProductRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/product/ProductRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/product/ProductRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/table/OrderStatusRecordTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderStatusRecordTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/table/OrderStatusRecordTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderStatusRecordTest.java diff --git a/src/test/java/kitchenpos/domain/table/OrderTableRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderTableRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/table/OrderTableRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderTableRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/table/OrderTableTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderTableTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/table/OrderTableTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/table/OrderTableTest.java diff --git a/src/test/java/kitchenpos/domain/table/TableGroupRepositoryTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/table/TableGroupRepositoryTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/table/TableGroupRepositoryTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/table/TableGroupRepositoryTest.java diff --git a/src/test/java/kitchenpos/domain/table/TableGroupTest.java b/kitchenpos-core/src/test/java/kitchenpos/domain/table/TableGroupTest.java similarity index 100% rename from src/test/java/kitchenpos/domain/table/TableGroupTest.java rename to kitchenpos-core/src/test/java/kitchenpos/domain/table/TableGroupTest.java diff --git a/kitchenpos-external-api/build.gradle b/kitchenpos-external-api/build.gradle new file mode 100644 index 0000000000..db2ee16afd --- /dev/null +++ b/kitchenpos-external-api/build.gradle @@ -0,0 +1,16 @@ +dependencies { + implementation project(':kitchenpos-core') + implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.flywaydb:flyway-core' + runtimeOnly 'com.h2database:h2' +} + +bootJar { + enabled = true +} + +jar { + enabled false +} diff --git a/src/main/java/kitchenpos/Application.java b/kitchenpos-external-api/src/main/java/kitchenpos/Application.java similarity index 100% rename from src/main/java/kitchenpos/Application.java rename to kitchenpos-external-api/src/main/java/kitchenpos/Application.java diff --git a/src/main/java/kitchenpos/application/menu/MenuGroupService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/menu/MenuGroupService.java similarity index 100% rename from src/main/java/kitchenpos/application/menu/MenuGroupService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/menu/MenuGroupService.java diff --git a/src/main/java/kitchenpos/application/menu/MenuService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/menu/MenuService.java similarity index 100% rename from src/main/java/kitchenpos/application/menu/MenuService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/menu/MenuService.java diff --git a/src/main/java/kitchenpos/application/order/OrderService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/order/OrderService.java similarity index 100% rename from src/main/java/kitchenpos/application/order/OrderService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/order/OrderService.java diff --git a/src/main/java/kitchenpos/application/product/ProductService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/product/ProductService.java similarity index 100% rename from src/main/java/kitchenpos/application/product/ProductService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/product/ProductService.java diff --git a/src/main/java/kitchenpos/application/table/TableGroupService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/table/TableGroupService.java similarity index 100% rename from src/main/java/kitchenpos/application/table/TableGroupService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/table/TableGroupService.java diff --git a/src/main/java/kitchenpos/application/table/TableService.java b/kitchenpos-external-api/src/main/java/kitchenpos/application/table/TableService.java similarity index 100% rename from src/main/java/kitchenpos/application/table/TableService.java rename to kitchenpos-external-api/src/main/java/kitchenpos/application/table/TableService.java diff --git a/src/main/java/kitchenpos/dto/common/response/ErrorResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/common/response/ErrorResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/common/response/ErrorResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/common/response/ErrorResponse.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapper.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuGroupMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuMapper.java diff --git a/src/main/java/kitchenpos/dto/menu/mapper/MenuMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/mapper/MenuMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/mapper/MenuMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/menu/request/MenuCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/request/MenuCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/menu/request/MenuGroupCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuGroupCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/request/MenuGroupCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuGroupCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/menu/request/MenuProductCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuProductCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/request/MenuProductCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/request/MenuProductCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/menu/response/MenuGroupResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuGroupResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/response/MenuGroupResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuGroupResponse.java diff --git a/src/main/java/kitchenpos/dto/menu/response/MenuProductResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuProductResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/response/MenuProductResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuProductResponse.java diff --git a/src/main/java/kitchenpos/dto/menu/response/MenuResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/menu/response/MenuResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/menu/response/MenuResponse.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapper.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderLineItemMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderMapper.java diff --git a/src/main/java/kitchenpos/dto/order/mapper/OrderMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/mapper/OrderMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/mapper/OrderMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/order/request/OrderCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/request/OrderCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/order/request/OrderLineItemCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderLineItemCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/request/OrderLineItemCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderLineItemCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/order/request/OrderStatusChangeRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderStatusChangeRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/request/OrderStatusChangeRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/request/OrderStatusChangeRequest.java diff --git a/src/main/java/kitchenpos/dto/order/response/OrderLineItemResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/response/OrderLineItemResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/response/OrderLineItemResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/response/OrderLineItemResponse.java diff --git a/src/main/java/kitchenpos/dto/order/response/OrderResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/order/response/OrderResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/order/response/OrderResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/order/response/OrderResponse.java diff --git a/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/product/mapper/ProductMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/mapper/ProductMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductMapper.java diff --git a/src/main/java/kitchenpos/dto/product/mapper/ProductMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/mapper/ProductMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/mapper/ProductMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/product/request/ProductCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/request/ProductCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/request/ProductCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/request/ProductCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/product/response/ProductResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/product/response/ProductResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/product/response/ProductResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/product/response/ProductResponse.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/OrderTableMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapper.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/OrderTableMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/OrderTableMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapper.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapper.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapper.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapper.java diff --git a/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapperImpl.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapperImpl.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapperImpl.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/mapper/TableGroupDtoMapperImpl.java diff --git a/src/main/java/kitchenpos/dto/table/request/NumberOfGuestsChangeRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/NumberOfGuestsChangeRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/request/NumberOfGuestsChangeRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/NumberOfGuestsChangeRequest.java diff --git a/src/main/java/kitchenpos/dto/table/request/OrderTableCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/OrderTableCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/request/OrderTableCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/OrderTableCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/table/request/OrderTableIdRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/OrderTableIdRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/request/OrderTableIdRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/OrderTableIdRequest.java diff --git a/src/main/java/kitchenpos/dto/table/request/TableEmptyChangeRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/TableEmptyChangeRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/request/TableEmptyChangeRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/TableEmptyChangeRequest.java diff --git a/src/main/java/kitchenpos/dto/table/request/TableGroupCreateRequest.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/TableGroupCreateRequest.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/request/TableGroupCreateRequest.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/request/TableGroupCreateRequest.java diff --git a/src/main/java/kitchenpos/dto/table/response/OrderTableResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/response/OrderTableResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/response/OrderTableResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/response/OrderTableResponse.java diff --git a/src/main/java/kitchenpos/dto/table/response/TableGroupResponse.java b/kitchenpos-external-api/src/main/java/kitchenpos/dto/table/response/TableGroupResponse.java similarity index 100% rename from src/main/java/kitchenpos/dto/table/response/TableGroupResponse.java rename to kitchenpos-external-api/src/main/java/kitchenpos/dto/table/response/TableGroupResponse.java diff --git a/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java similarity index 100% rename from src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java diff --git a/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/menu/MenuGroupRestController.java diff --git a/src/main/java/kitchenpos/ui/menu/MenuRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/menu/MenuRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/menu/MenuRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/menu/MenuRestController.java diff --git a/src/main/java/kitchenpos/ui/order/OrderRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/order/OrderRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/order/OrderRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/order/OrderRestController.java diff --git a/src/main/java/kitchenpos/ui/product/ProductRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/product/ProductRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/product/ProductRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/product/ProductRestController.java diff --git a/src/main/java/kitchenpos/ui/table/TableGroupRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/table/TableGroupRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/table/TableGroupRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/table/TableGroupRestController.java diff --git a/src/main/java/kitchenpos/ui/table/TableRestController.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/table/TableRestController.java similarity index 100% rename from src/main/java/kitchenpos/ui/table/TableRestController.java rename to kitchenpos-external-api/src/main/java/kitchenpos/ui/table/TableRestController.java diff --git a/src/main/resources/application.yml b/kitchenpos-external-api/src/main/resources/application.yml similarity index 100% rename from src/main/resources/application.yml rename to kitchenpos-external-api/src/main/resources/application.yml diff --git a/src/main/resources/db/migration/V1__Initialize_project_tables.sql b/kitchenpos-external-api/src/main/resources/db/migration/V1__Initialize_project_tables.sql similarity index 100% rename from src/main/resources/db/migration/V1__Initialize_project_tables.sql rename to kitchenpos-external-api/src/main/resources/db/migration/V1__Initialize_project_tables.sql diff --git a/src/main/resources/db/migration/V2__Insert_default_data.sql b/kitchenpos-external-api/src/main/resources/db/migration/V2__Insert_default_data.sql similarity index 100% rename from src/main/resources/db/migration/V2__Insert_default_data.sql rename to kitchenpos-external-api/src/main/resources/db/migration/V2__Insert_default_data.sql diff --git a/src/main/resources/db/migration/V3__Add_MenuProduct_price.sql b/kitchenpos-external-api/src/main/resources/db/migration/V3__Add_MenuProduct_price.sql similarity index 100% rename from src/main/resources/db/migration/V3__Add_MenuProduct_price.sql rename to kitchenpos-external-api/src/main/resources/db/migration/V3__Add_MenuProduct_price.sql diff --git a/src/main/resources/db/migration/V4__Add_Ordered_Menu.sql b/kitchenpos-external-api/src/main/resources/db/migration/V4__Add_Ordered_Menu.sql similarity index 100% rename from src/main/resources/db/migration/V4__Add_Ordered_Menu.sql rename to kitchenpos-external-api/src/main/resources/db/migration/V4__Add_Ordered_Menu.sql diff --git a/src/main/resources/db/migration/V5__ADD_OrderStatusRecord.sql b/kitchenpos-external-api/src/main/resources/db/migration/V5__ADD_OrderStatusRecord.sql similarity index 100% rename from src/main/resources/db/migration/V5__ADD_OrderStatusRecord.sql rename to kitchenpos-external-api/src/main/resources/db/migration/V5__ADD_OrderStatusRecord.sql diff --git a/src/main/resources/static/empty.txt b/kitchenpos-external-api/src/main/resources/static/empty.txt similarity index 100% rename from src/main/resources/static/empty.txt rename to kitchenpos-external-api/src/main/resources/static/empty.txt diff --git a/src/main/resources/templates/empty.txt b/kitchenpos-external-api/src/main/resources/templates/empty.txt similarity index 100% rename from src/main/resources/templates/empty.txt rename to kitchenpos-external-api/src/main/resources/templates/empty.txt diff --git a/src/test/java/kitchenpos/ApplicationTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java similarity index 100% rename from src/test/java/kitchenpos/ApplicationTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java diff --git a/src/test/java/kitchenpos/ServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ServiceTest.java similarity index 100% rename from src/test/java/kitchenpos/ServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ServiceTest.java diff --git a/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java similarity index 94% rename from src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java index 443bf51884..448c6f2e6b 100644 --- a/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuGroupServiceTest.java @@ -7,6 +7,7 @@ import kitchenpos.ServiceTest; import kitchenpos.dto.menu.request.MenuGroupCreateRequest; import kitchenpos.dto.menu.response.MenuGroupResponse; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -37,7 +38,7 @@ class MenuGroupServiceTest { List actual = menuGroupService.list(); - assertThat(actual).hasSize(2) + Assertions.assertThat(actual).hasSize(2) .extracting("id") .containsExactly(menuGroup1Id, menuGroup2Id); } diff --git a/src/test/java/kitchenpos/application/menu/MenuServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuServiceTest.java similarity index 97% rename from src/test/java/kitchenpos/application/menu/MenuServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuServiceTest.java index 6e112b1473..c527e70579 100644 --- a/src/test/java/kitchenpos/application/menu/MenuServiceTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/application/menu/MenuServiceTest.java @@ -17,6 +17,7 @@ import kitchenpos.dto.menu.response.MenuResponse; import kitchenpos.exception.badrequest.MenuGroupNotExistsException; import kitchenpos.exception.badrequest.ProductNotExistsException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -78,7 +79,7 @@ class MenuServiceTest { List actual = menuService.list(); - assertThat(actual).hasSize(2) + Assertions.assertThat(actual).hasSize(2) .extracting("id") .containsExactly(menuId1, menuId2); } diff --git a/src/test/java/kitchenpos/application/order/OrderServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/order/OrderServiceTest.java similarity index 98% rename from src/test/java/kitchenpos/application/order/OrderServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/order/OrderServiceTest.java index 036b47a0ef..dff27f7092 100644 --- a/src/test/java/kitchenpos/application/order/OrderServiceTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/application/order/OrderServiceTest.java @@ -28,6 +28,7 @@ import kitchenpos.exception.badrequest.MenuNotExistsException; import kitchenpos.exception.badrequest.OrderNotExistsException; import kitchenpos.exception.badrequest.OrderTableNotExistsException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -79,7 +80,7 @@ class OrderServiceTest { Optional actual = orderStatusRecordRepository.findById(orderId); - assertThat(actual).isPresent(); + Assertions.assertThat(actual).isPresent(); } @Test @@ -135,7 +136,7 @@ class OrderServiceTest { List actual = orderService.list(); - assertThat(actual).hasSize(1) + Assertions.assertThat(actual).hasSize(1) .extracting("id") .containsExactly(orderId); } diff --git a/src/test/java/kitchenpos/application/product/ProductServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/product/ProductServiceTest.java similarity index 92% rename from src/test/java/kitchenpos/application/product/ProductServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/product/ProductServiceTest.java index 2e83f06484..ca789c8b82 100644 --- a/src/test/java/kitchenpos/application/product/ProductServiceTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/application/product/ProductServiceTest.java @@ -7,6 +7,7 @@ import kitchenpos.ServiceTest; import kitchenpos.dto.product.request.ProductCreateRequest; import kitchenpos.dto.product.response.ProductResponse; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -32,7 +33,7 @@ class ProductServiceTest { List actual = productService.list(); - assertThat(actual).hasSize(1) + Assertions.assertThat(actual).hasSize(1) .extracting("id") .containsOnly(productId); } diff --git a/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java similarity index 100% rename from src/test/java/kitchenpos/application/table/TableGroupServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/table/TableGroupServiceTest.java diff --git a/src/test/java/kitchenpos/application/table/TableServiceTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/application/table/TableServiceTest.java similarity index 96% rename from src/test/java/kitchenpos/application/table/TableServiceTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/application/table/TableServiceTest.java index fe85a3f211..0a8ed36889 100644 --- a/src/test/java/kitchenpos/application/table/TableServiceTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/application/table/TableServiceTest.java @@ -11,6 +11,7 @@ import kitchenpos.dto.table.request.OrderTableCreateRequest; import kitchenpos.dto.table.response.OrderTableResponse; import kitchenpos.exception.badrequest.OrderNotExistsException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -44,7 +45,7 @@ class TableServiceTest { List actual = tableService.list(); - assertThat(actual).hasSize(2) + Assertions.assertThat(actual).hasSize(2) .extracting("id") .containsExactly(orderTableId1, orderTableId2); } diff --git a/src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java similarity index 95% rename from src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java index ebba6ffb6e..7d1304d879 100644 --- a/src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuGroupRestControllerTest.java @@ -1,6 +1,5 @@ package kitchenpos.ui.menu; -import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.refEq; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -13,6 +12,7 @@ import kitchenpos.dto.menu.request.MenuGroupCreateRequest; import kitchenpos.dto.menu.response.MenuGroupResponse; import kitchenpos.ui.product.RestControllerTest; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; @@ -48,7 +48,7 @@ class MenuGroupRestControllerTest extends RestControllerTest { mvcResult.getResponse().getContentAsByteArray(), new TypeReference>() { }); - assertThat(menuGroupResponses).hasSize(1) + Assertions.assertThat(menuGroupResponses).hasSize(1) .usingFieldByFieldElementComparator() .containsExactly(new MenuGroupResponse(expected.getId(), expected.getName())); } diff --git a/src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java similarity index 98% rename from src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java index 3ed3d6deb9..15d7634419 100644 --- a/src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/menu/MenuRestControllerTest.java @@ -1,6 +1,5 @@ package kitchenpos.ui.menu; -import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -21,6 +20,7 @@ import kitchenpos.exception.badrequest.NegativePriceException; import kitchenpos.exception.badrequest.ProductNotExistsException; import kitchenpos.ui.product.RestControllerTest; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; @@ -124,7 +124,7 @@ class MenuRestControllerTest extends RestControllerTest { new TypeReference>() { }); - assertThat(content).hasSize(1) + Assertions.assertThat(content).hasSize(1) .extracting("id") .containsExactly(1L); } diff --git a/src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java similarity index 98% rename from src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java index f9a7b0dc6c..59379cf539 100644 --- a/src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/order/OrderRestControllerTest.java @@ -29,6 +29,7 @@ import kitchenpos.exception.badrequest.OrderTableEmptyException; import kitchenpos.exception.badrequest.OrderTableNotExistsException; import kitchenpos.ui.product.RestControllerTest; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; @@ -125,7 +126,7 @@ class OrderRestControllerTest extends RestControllerTest { new TypeReference>() { }); - assertThat(content).hasSize(1) + Assertions.assertThat(content).hasSize(1) .extracting("id") .containsExactly(expected.getId()); } diff --git a/src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java similarity index 96% rename from src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java index b4a715b856..919226c627 100644 --- a/src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/product/ProductRestControllerTest.java @@ -1,6 +1,5 @@ package kitchenpos.ui.product; -import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -15,6 +14,7 @@ import kitchenpos.dto.product.request.ProductCreateRequest; import kitchenpos.dto.product.response.ProductResponse; import kitchenpos.exception.badrequest.NegativePriceException; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; @@ -64,7 +64,7 @@ class ProductRestControllerTest extends RestControllerTest { new TypeReference>() { }); - assertThat(content).hasSize(1) + Assertions.assertThat(content).hasSize(1) .extracting("id") .containsExactly(1L); } diff --git a/src/test/java/kitchenpos/ui/product/RestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/product/RestControllerTest.java similarity index 96% rename from src/test/java/kitchenpos/ui/product/RestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/product/RestControllerTest.java index 8081c13d81..b550c93e17 100644 --- a/src/test/java/kitchenpos/ui/product/RestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/product/RestControllerTest.java @@ -10,7 +10,6 @@ import kitchenpos.ui.menu.MenuGroupRestController; import kitchenpos.ui.menu.MenuRestController; import kitchenpos.ui.order.OrderRestController; -import kitchenpos.ui.product.ProductRestController; import kitchenpos.ui.table.TableGroupRestController; import kitchenpos.ui.table.TableRestController; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/kitchenpos/ui/table/TableGroupRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/table/TableGroupRestControllerTest.java similarity index 100% rename from src/test/java/kitchenpos/ui/table/TableGroupRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/table/TableGroupRestControllerTest.java diff --git a/src/test/java/kitchenpos/ui/table/TableRestControllerTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ui/table/TableRestControllerTest.java similarity index 98% rename from src/test/java/kitchenpos/ui/table/TableRestControllerTest.java rename to kitchenpos-external-api/src/test/java/kitchenpos/ui/table/TableRestControllerTest.java index 6e5eea8d30..5ea53b93cc 100644 --- a/src/test/java/kitchenpos/ui/table/TableRestControllerTest.java +++ b/kitchenpos-external-api/src/test/java/kitchenpos/ui/table/TableRestControllerTest.java @@ -22,6 +22,7 @@ import kitchenpos.exception.badrequest.OrderTableEmptyException; import kitchenpos.exception.badrequest.OrderTableNotExistsException; import kitchenpos.ui.product.RestControllerTest; +import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MvcResult; @@ -58,7 +59,7 @@ class TableRestControllerTest extends RestControllerTest { List content = objectMapper.readValue( mvcResult.getResponse().getContentAsByteArray(), new TypeReference>() { }); - assertThat(content).hasSize(1) + Assertions.assertThat(content).hasSize(1) .extracting("id") .containsExactly(1L); } diff --git a/src/test/resources/application.yml b/kitchenpos-external-api/src/test/resources/application.yml similarity index 100% rename from src/test/resources/application.yml rename to kitchenpos-external-api/src/test/resources/application.yml diff --git a/src/test/resources/schema.sql b/kitchenpos-external-api/src/test/resources/schema.sql similarity index 100% rename from src/test/resources/schema.sql rename to kitchenpos-external-api/src/test/resources/schema.sql diff --git a/settings.gradle b/settings.gradle index db5850c279..1c7bac8de9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,6 @@ rootProject.name = 'kitchenpos' + +include( + 'kitchenpos-core', + 'kitchenpos-external-api' +) From b77664a035d2597eb79e113567ba212141c9f2d3 Mon Sep 17 00:00:00 2001 From: Ohzzi Date: Fri, 4 Nov 2022 10:30:33 +0900 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20core=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=EC=9D=98=20springboot=20web=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kitchenpos-core/build.gradle | 1 - .../kitchenpos/exception/ApplicationException.java | 12 +++++------- .../exception/badrequest/BadRequestException.java | 5 +++-- .../kitchenpos/ui/common/GlobalControllerAdvice.java | 2 +- .../src/test/java/kitchenpos/ApplicationTest.java | 11 ----------- 5 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java diff --git a/kitchenpos-core/build.gradle b/kitchenpos-core/build.gradle index 6b17bf366f..135ebaab69 100644 --- a/kitchenpos-core/build.gradle +++ b/kitchenpos-core/build.gradle @@ -1,5 +1,4 @@ dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' testRuntimeOnly 'com.h2database:h2' } diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java index ec01c68ab9..e4551a53b8 100644 --- a/kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java +++ b/kitchenpos-core/src/main/java/kitchenpos/exception/ApplicationException.java @@ -1,17 +1,15 @@ package kitchenpos.exception; -import org.springframework.http.HttpStatus; - public abstract class ApplicationException extends RuntimeException { - private final HttpStatus httpStatus; + private final int httpStatusCode; - public ApplicationException(final String message, final HttpStatus httpStatus) { + public ApplicationException(final String message, final int httpStatusCode) { super(message); - this.httpStatus = httpStatus; + this.httpStatusCode = httpStatusCode; } - public HttpStatus getHttpStatus() { - return httpStatus; + public int getHttpStatusCode() { + return httpStatusCode; } } diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java index 0f31be9d86..f567b816ef 100644 --- a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java +++ b/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/BadRequestException.java @@ -1,11 +1,12 @@ package kitchenpos.exception.badrequest; import kitchenpos.exception.ApplicationException; -import org.springframework.http.HttpStatus; public abstract class BadRequestException extends ApplicationException { + private static final int BAD_REQUEST_CODE = 400; + protected BadRequestException(final String message) { - super(message, HttpStatus.BAD_REQUEST); + super(message, BAD_REQUEST_CODE); } } diff --git a/kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java b/kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java index ebfdaf9399..f9b2f3d5de 100644 --- a/kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java +++ b/kitchenpos-external-api/src/main/java/kitchenpos/ui/common/GlobalControllerAdvice.java @@ -12,7 +12,7 @@ public class GlobalControllerAdvice { @ExceptionHandler(ApplicationException.class) public ResponseEntity handleApplicationException(final ApplicationException e) { - return ResponseEntity.status(e.getHttpStatus()).body(new ErrorResponse(e.getMessage())); + return ResponseEntity.status(e.getHttpStatusCode()).body(new ErrorResponse(e.getMessage())); } @ExceptionHandler(RuntimeException.class) diff --git a/kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java b/kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java deleted file mode 100644 index deac6fc21d..0000000000 --- a/kitchenpos-external-api/src/test/java/kitchenpos/ApplicationTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package kitchenpos; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class ApplicationTest { - @Test - void contextLoads() { - } -} From 3d8189f8cebb546109bbf57fe351fd4ad2125ff1 Mon Sep 17 00:00:00 2001 From: Ohzzi Date: Fri, 4 Nov 2022 10:49:41 +0900 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=EC=84=9C=EB=B9=84=EC=8A=A4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=B0=9C=EC=83=9D=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EC=98=88=EC=99=B8=EB=A5=BC=20external-api=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/badrequest/DuplicateOrderLineItemException.java | 0 .../exception/badrequest/MenuGroupNotExistsException.java | 0 .../kitchenpos/exception/badrequest/MenuNotExistsException.java | 0 .../kitchenpos/exception/badrequest/OrderNotExistsException.java | 0 .../exception/badrequest/OrderTableNotExistsException.java | 0 .../exception/badrequest/ProductNotExistsException.java | 0 .../exception/badrequest/TableGroupNotExistsException.java | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java (100%) rename {kitchenpos-core => kitchenpos-external-api}/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java (100%) diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/DuplicateOrderLineItemException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/MenuGroupNotExistsException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/MenuNotExistsException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/OrderNotExistsException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/OrderTableNotExistsException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/ProductNotExistsException.java diff --git a/kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java b/kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java similarity index 100% rename from kitchenpos-core/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java rename to kitchenpos-external-api/src/main/java/kitchenpos/exception/badrequest/TableGroupNotExistsException.java From bbcb9c64a72e602ea3fa021425f3d35e63ef311a Mon Sep 17 00:00:00 2001 From: Ohzzi Date: Fri, 4 Nov 2022 10:52:47 +0900 Subject: [PATCH 4/5] =?UTF-8?q?refactor:=20bootJar,=20jar=20enabled=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=EC=9D=84=20subproject=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 8 ++++++++ kitchenpos-core/build.gradle | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index ab58ebdf3a..a1ee2349fe 100644 --- a/build.gradle +++ b/build.gradle @@ -23,6 +23,14 @@ subprojects { } } + bootJar { + enabled = false + } + + jar { + enabled = true + } + test { useJUnitPlatform() } diff --git a/kitchenpos-core/build.gradle b/kitchenpos-core/build.gradle index 135ebaab69..b51290ba89 100644 --- a/kitchenpos-core/build.gradle +++ b/kitchenpos-core/build.gradle @@ -2,11 +2,3 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' testRuntimeOnly 'com.h2database:h2' } - -bootJar { - enabled = false -} - -jar { - enabled true -} From 0a6a044c4fa1899e50040ed458048e61bfdae055 Mon Sep 17 00:00:00 2001 From: Ohzzi Date: Fri, 4 Nov 2022 17:23:58 +0900 Subject: [PATCH 5/5] =?UTF-8?q?refactor:=20forEach=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kitchenpos/domain/table/OrderTable.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java index 2bf64849c0..98d1547bf2 100644 --- a/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java +++ b/kitchenpos-core/src/main/java/kitchenpos/domain/table/OrderTable.java @@ -62,11 +62,9 @@ public void changeEmpty(final boolean empty) { } private void validateCookingOrMealOrderNotExistsWhenChangeEmpty() { - orderStatusRecords.forEach(orderStatusRecord -> { - if (orderStatusRecord.isNotCompleted()) { - throw new CookingOrMealOrderTableCannotChangeEmptyException(); - } - }); + if (orderStatusRecords.stream().anyMatch(OrderStatusRecord::isNotCompleted)) { + throw new CookingOrMealOrderTableCannotChangeEmptyException(); + } } private void validateNotGrouped() { @@ -102,11 +100,9 @@ public void ungroup() { } private void validateCookingOrMealOrderNotExistsWhenUngroup() { - orderStatusRecords.forEach(orderStatusRecord -> { - if (orderStatusRecord.isNotCompleted()) { - throw new CookingOrMealOrderTableCannotUngroupedException(); - } - }); + if (orderStatusRecords.stream().anyMatch(OrderStatusRecord::isNotCompleted)) { + throw new CookingOrMealOrderTableCannotUngroupedException(); + } } public void add(final OrderStatusRecord orderStatusRecord) {