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 {