From d7189d7fa631e77744db17df75c793cfd53d464b Mon Sep 17 00:00:00 2001 From: sangminnim Date: Tue, 31 Oct 2023 18:39:09 +0900 Subject: [PATCH 1/3] refactor: new -> create --- .../server/certification/service/CertificationService.java | 4 ++-- .../server/certification/service/cq/CertificationCommand.java | 2 +- .../certification/service/cq/EmailVerificationCommand.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/coffeemeet/server/certification/service/CertificationService.java b/src/main/java/coffeemeet/server/certification/service/CertificationService.java index aa028ba2..eff6c4e2 100644 --- a/src/main/java/coffeemeet/server/certification/service/CertificationService.java +++ b/src/main/java/coffeemeet/server/certification/service/CertificationService.java @@ -42,7 +42,7 @@ public void registerCertification(long userId, String email, String departmentNa String businessCardUrl = s3MediaService.getUrl(key); Department department = Department.valueOf(departmentName); User user = userQuery.getUserById(userId); - certificationCommand.newCertification(companyEmail, businessCardUrl, department, user); + certificationCommand.createCertification(companyEmail, businessCardUrl, department, user); } private void uploadBusinessCard(long userId, String key, File businessCardUrl) { @@ -61,7 +61,7 @@ public void sendVerificationMail(Long userId, String email) { String verificationCode = generateVerificationCode(); emailService.sendVerificationCode(companyEmail, verificationCode); - emailVerificationCommand.newEmailVerification(userId, companyEmail, verificationCode); + emailVerificationCommand.createEmailVerification(userId, companyEmail, verificationCode); } public void compareCode(Long userId, String verificationCode) { diff --git a/src/main/java/coffeemeet/server/certification/service/cq/CertificationCommand.java b/src/main/java/coffeemeet/server/certification/service/cq/CertificationCommand.java index 791b9afd..5b8fc603 100644 --- a/src/main/java/coffeemeet/server/certification/service/cq/CertificationCommand.java +++ b/src/main/java/coffeemeet/server/certification/service/cq/CertificationCommand.java @@ -22,7 +22,7 @@ public class CertificationCommand { private final CertificationRepository certificationRepository; - public void newCertification(CompanyEmail companyEmail, String businessCardUrl, + public void createCertification(CompanyEmail companyEmail, String businessCardUrl, Department department, User user) { certificationRepository.save( Certification.builder() diff --git a/src/main/java/coffeemeet/server/certification/service/cq/EmailVerificationCommand.java b/src/main/java/coffeemeet/server/certification/service/cq/EmailVerificationCommand.java index 37323810..5412ecc3 100644 --- a/src/main/java/coffeemeet/server/certification/service/cq/EmailVerificationCommand.java +++ b/src/main/java/coffeemeet/server/certification/service/cq/EmailVerificationCommand.java @@ -12,7 +12,7 @@ public class EmailVerificationCommand { private final EmailVerificationRepository emailVerificationRepository; - public void newEmailVerification(Long userId, CompanyEmail companyEmail, + public void createEmailVerification(Long userId, CompanyEmail companyEmail, String verificationCode) { emailVerificationRepository.save(new EmailVerification(userId, companyEmail, verificationCode)); } From a50f13f88e454f549f504eae975ea91262e7604d Mon Sep 17 00:00:00 2001 From: sangminnim Date: Tue, 31 Oct 2023 18:39:24 +0900 Subject: [PATCH 2/3] =?UTF-8?q?test:=20new=20->=20create=20=EB=A9=94?= =?UTF-8?q?=EC=86=8C=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../certification/service/CertificationServiceTest.java | 4 ++-- .../certification/service/cq/CertificationCommandTest.java | 4 ++-- .../service/cq/EmailVerificationCommandTest.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/coffeemeet/server/certification/service/CertificationServiceTest.java b/src/test/java/coffeemeet/server/certification/service/CertificationServiceTest.java index 59e0ecc1..a23bb7fb 100644 --- a/src/test/java/coffeemeet/server/certification/service/CertificationServiceTest.java +++ b/src/test/java/coffeemeet/server/certification/service/CertificationServiceTest.java @@ -74,7 +74,7 @@ void registerCertificationTest() { // then then(s3MediaService).should().generateKey(any()); then(s3MediaService).should().upload(any(), any(File.class)); - then(certificationCommand).should().newCertification(any(), any(), any(), any()); + then(certificationCommand).should().createCertification(any(), any(), any(), any()); fileUtils.close(); } @@ -94,7 +94,7 @@ void sendVerificationMailTest() { then(certificationCommand).should(only()).hasDuplicatedCompanyEmail(any()); then(emailService).should(only()).sendVerificationCode(any(), anyString()); then(emailVerificationCommand).should(only()) - .newEmailVerification(anyLong(), any(), anyString()); + .createEmailVerification(anyLong(), any(), anyString()); } @Test diff --git a/src/test/java/coffeemeet/server/certification/service/cq/CertificationCommandTest.java b/src/test/java/coffeemeet/server/certification/service/cq/CertificationCommandTest.java index ddaf33b3..d0cd9db2 100644 --- a/src/test/java/coffeemeet/server/certification/service/cq/CertificationCommandTest.java +++ b/src/test/java/coffeemeet/server/certification/service/cq/CertificationCommandTest.java @@ -38,7 +38,7 @@ class CertificationCommandTest { @Test @DisplayName("새로운 Certification 객체를 저장할 수 있다.") - void newCertificationTest() { + void createCertificationTest() { // given CompanyEmail companyEmail = companyEmail(); String businessCardUrl = businessCardUrl(); @@ -46,7 +46,7 @@ void newCertificationTest() { User user = user(); // when - certificationCommand.newCertification(companyEmail, businessCardUrl, department, user); + certificationCommand.createCertification(companyEmail, businessCardUrl, department, user); // then then(certificationRepository).should(only()).save(any(Certification.class)); diff --git a/src/test/java/coffeemeet/server/certification/service/cq/EmailVerificationCommandTest.java b/src/test/java/coffeemeet/server/certification/service/cq/EmailVerificationCommandTest.java index d2e60dcc..996bb8a4 100644 --- a/src/test/java/coffeemeet/server/certification/service/cq/EmailVerificationCommandTest.java +++ b/src/test/java/coffeemeet/server/certification/service/cq/EmailVerificationCommandTest.java @@ -25,14 +25,14 @@ class EmailVerificationCommandTest { @Test @DisplayName("새로운 EmailVerification 객체를 저장할 수 있다.") - void newEmailVerificationTest() { + void createEmailVerificationTest() { // given EmailVerification emailVerification = emailVerification(); given(emailVerificationRepository.save(any(EmailVerification.class))).willReturn( emailVerification); // when - emailVerificationCommand.newEmailVerification(emailVerification.getUserId(), + emailVerificationCommand.createEmailVerification(emailVerification.getUserId(), emailVerification.getCompanyEmail(), emailVerification.getCode()); // then From 23beb5e487e6c6610c5ac4ebbba14097165b71fe Mon Sep 17 00:00:00 2001 From: sangminnim Date: Tue, 31 Oct 2023 18:40:58 +0900 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=ED=8C=A8=ED=82=A4=EC=A7=80=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../certification/controller/CertificationController.java | 4 ++-- .../server/certification/{ => controller}/dto/EmailDto.java | 2 +- .../{ => controller}/dto/VerificationCodeDto.java | 2 +- .../server/common/fixture/entity/CertificationFixture.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename src/main/java/coffeemeet/server/certification/{ => controller}/dto/EmailDto.java (81%) rename src/main/java/coffeemeet/server/certification/{ => controller}/dto/VerificationCodeDto.java (84%) diff --git a/src/main/java/coffeemeet/server/certification/controller/CertificationController.java b/src/main/java/coffeemeet/server/certification/controller/CertificationController.java index 197b8c61..62b62ada 100644 --- a/src/main/java/coffeemeet/server/certification/controller/CertificationController.java +++ b/src/main/java/coffeemeet/server/certification/controller/CertificationController.java @@ -1,7 +1,7 @@ package coffeemeet.server.certification.controller; -import coffeemeet.server.certification.dto.EmailDto; -import coffeemeet.server.certification.dto.VerificationCodeDto; +import coffeemeet.server.certification.controller.dto.EmailDto; +import coffeemeet.server.certification.controller.dto.VerificationCodeDto; import coffeemeet.server.certification.service.CertificationService; import coffeemeet.server.common.annotation.Login; import coffeemeet.server.common.util.FileUtils; diff --git a/src/main/java/coffeemeet/server/certification/dto/EmailDto.java b/src/main/java/coffeemeet/server/certification/controller/dto/EmailDto.java similarity index 81% rename from src/main/java/coffeemeet/server/certification/dto/EmailDto.java rename to src/main/java/coffeemeet/server/certification/controller/dto/EmailDto.java index 63d9fddc..4d04f708 100644 --- a/src/main/java/coffeemeet/server/certification/dto/EmailDto.java +++ b/src/main/java/coffeemeet/server/certification/controller/dto/EmailDto.java @@ -1,4 +1,4 @@ -package coffeemeet.server.certification.dto; +package coffeemeet.server.certification.controller.dto; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotNull; diff --git a/src/main/java/coffeemeet/server/certification/dto/VerificationCodeDto.java b/src/main/java/coffeemeet/server/certification/controller/dto/VerificationCodeDto.java similarity index 84% rename from src/main/java/coffeemeet/server/certification/dto/VerificationCodeDto.java rename to src/main/java/coffeemeet/server/certification/controller/dto/VerificationCodeDto.java index 11035e5c..e749309f 100644 --- a/src/main/java/coffeemeet/server/certification/dto/VerificationCodeDto.java +++ b/src/main/java/coffeemeet/server/certification/controller/dto/VerificationCodeDto.java @@ -1,4 +1,4 @@ -package coffeemeet.server.certification.dto; +package coffeemeet.server.certification.controller.dto; import jakarta.validation.constraints.NotNull; import org.hibernate.validator.constraints.Length; diff --git a/src/test/java/coffeemeet/server/common/fixture/entity/CertificationFixture.java b/src/test/java/coffeemeet/server/common/fixture/entity/CertificationFixture.java index 02118b08..6ac4d0e1 100644 --- a/src/test/java/coffeemeet/server/common/fixture/entity/CertificationFixture.java +++ b/src/test/java/coffeemeet/server/common/fixture/entity/CertificationFixture.java @@ -6,8 +6,8 @@ import coffeemeet.server.certification.domain.CompanyEmail; import coffeemeet.server.certification.domain.Department; import coffeemeet.server.certification.domain.EmailVerification; -import coffeemeet.server.certification.dto.EmailDto; -import coffeemeet.server.certification.dto.VerificationCodeDto; +import coffeemeet.server.certification.controller.dto.EmailDto; +import coffeemeet.server.certification.controller.dto.VerificationCodeDto; import coffeemeet.server.user.domain.User; import org.instancio.Instancio; import org.instancio.internal.generator.domain.internet.EmailGenerator;