From dee1f212f9a06dbfa82224e28d818e960fa4e7af Mon Sep 17 00:00:00 2001 From: CheChe903 Date: Sun, 5 Apr 2026 21:21:08 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20prod=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=84=A4=EC=A0=95=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- src/main/resources/application-prod.yml | 22 ++++++++++++ src/main/resources/application.yml | 2 +- .../service/CrewDocumentServiceTest.java | 34 ------------------- 4 files changed, 24 insertions(+), 36 deletions(-) create mode 100644 src/main/resources/application-prod.yml diff --git a/.gitignore b/.gitignore index 2071836..d964430 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,4 @@ out/ ### VS Code ### .vscode/ -application-*.yml +src/main/resources/application-private.yml diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..fadf8d7 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,22 @@ +server: + port: 8080 + +spring: + datasource: + url: ${PROD_DB_URL} + username: ${PROD_DB_USERNAME} + password: ${PROD_DB_PASSWORD} + driver-class-name: com.mysql.cj.jdbc.Driver + + jpa: + hibernate: + ddl-auto: update + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL8Dialect + +cors: + allowed-origins: https://crew-wiki.site, https://api.crew-wiki.site + +swagger: + server-url: https://api.crew-wiki.site diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 713047c..cc83341 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: include: private - active: local # prod (배포 환경) + active: local # 기본 로컬 실행 프로필 diff --git a/src/test/java/com/wooteco/wiki/document/service/CrewDocumentServiceTest.java b/src/test/java/com/wooteco/wiki/document/service/CrewDocumentServiceTest.java index 422355c..b52de5f 100644 --- a/src/test/java/com/wooteco/wiki/document/service/CrewDocumentServiceTest.java +++ b/src/test/java/com/wooteco/wiki/document/service/CrewDocumentServiceTest.java @@ -89,40 +89,6 @@ void getDocumentLatestVersion_success_byExistsDocument() { } } - @Nested - @DisplayName("문서 uuid로 삭제 기능") - class deleteByUuid { - - @DisplayName("존재하는 문서 id일 경우 문서가 로그들과 함께 삭제된다") - @Test - void deleteById_success_byExistsId() { - // given - DocumentResponse documentResponse = crewDocumentService.create( - CrewDocumentFixture.createDocumentCreateRequest("title1", "content1", "writer1", 10L, - UUID.randomUUID())); - - // before then - assertThat(documentRepository.findAll()).hasSize(1); - assertThat(historyRepository.findAll()).hasSize(1); - - // when - crewDocumentService.deleteByUuid(documentResponse.documentUUID()); - - // after then - assertThat(documentRepository.findAll()).hasSize(0); - assertThat(historyRepository.findAll()).hasSize(0); - } - - @DisplayName("존재하지 않는 문서의 id일 경우 예외가 발생한다 : WikiException.DOCUMENT_NOT_FOUND") - @Test - void deleteById_throwsException_byNonExistsId() { - // when & then - WikiException ex = assertThrows(WikiException.class, - () -> crewDocumentService.deleteByUuid(UUID.randomUUID())); - assertThat(ex.getErrorCode()).isEqualTo(DOCUMENT_NOT_FOUND); - } - } - @Nested @DisplayName("문서 uuid로 삭제 기능") class DeleteByUuid {