-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from KUSITMS-29th-TEAM-B/feat/flight-40
feat: 경험 삭제 API 구현(#40)
- Loading branch information
Showing
29 changed files
with
327 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...om/bamyanggang/apimodule/domain/experience/application/service/ExperienceDeleteService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.bamyanggang.apimodule.domain.experience.application.service | ||
|
||
import com.bamyanggang.domainmodule.domain.experience.service.ExperienceRemover | ||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
import java.util.* | ||
|
||
@Service | ||
class ExperienceDeleteService( | ||
val experienceRemover: ExperienceRemover | ||
) { | ||
@Transactional | ||
fun deleteExperienceById(experienceId: UUID) { | ||
experienceRemover.remove(experienceId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...in/com/bamyanggang/apimodule/domain/experience/application/ExperienceCreateServiceTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//package com.bamyanggang.apimodule.domain.experience.application | ||
// | ||
//import com.bamyanggang.apimodule.domain.experience.application.dto.CreateExperience | ||
//import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceCreateService | ||
//import com.bamyanggang.commonmodule.fixture.generateFixture | ||
//import com.bamyanggang.domainmodule.domain.experience.service.ExperienceAppender | ||
//import com.bamyanggang.domainmodule.domain.experience.service.ExperienceContentAppender | ||
//import io.kotest.core.spec.style.BehaviorSpec | ||
//import io.mockk.every | ||
//import io.mockk.mockk | ||
//import io.mockk.verify | ||
//import java.util.* | ||
// | ||
//class ExperienceCreateServiceTest : BehaviorSpec({ | ||
// | ||
// val experienceAppender: ExperienceAppender = mockk() | ||
// val experienceContentAppender: ExperienceContentAppender = mockk() | ||
// val createExperienceService = ExperienceCreateService(experienceAppender, experienceContentAppender) | ||
// | ||
// Given("등록할 경험 Request과 응답이 주어지면") { | ||
// val request : CreateExperience.Request = generateFixture() | ||
// val response : CreateExperience.Response = generateFixture() | ||
// | ||
// When("ExperienceCreateService.createExperience가 호출 되었을 때" ) { | ||
// every { createExperienceService.createExperience(request) } returns response | ||
// | ||
// Then("experienceAppender.appendExperience가 호출된다.") { | ||
// verify { | ||
// experienceAppender.appendExperience( | ||
// request.title, | ||
// generateFixture<UUID>(), | ||
// request.startedAt, | ||
// request.endedAt | ||
// ) | ||
// } | ||
// } | ||
// | ||
// Then("experienceContentAppender.appendExperienceContent가 호출된다.") { | ||
// verify { | ||
// experienceContentAppender.appendExperienceContent( | ||
// generateFixture(), | ||
// generateFixture(), | ||
// generateFixture(), | ||
// ) | ||
// } | ||
// } | ||
// } | ||
// } | ||
//}) |
27 changes: 27 additions & 0 deletions
27
...in/com/bamyanggang/apimodule/domain/experience/application/ExperienceDeleteServiceTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.bamyanggang.apimodule.domain.experience.application | ||
|
||
import com.bamyanggang.apimodule.domain.experience.application.service.ExperienceDeleteService | ||
import com.bamyanggang.domainmodule.domain.experience.service.ExperienceRemover | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.every | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.* | ||
|
||
class ExperienceDeleteServiceTest : BehaviorSpec({ | ||
val experienceRemover = mockk<ExperienceRemover>() | ||
val experienceDeleteService = ExperienceDeleteService(experienceRemover) | ||
|
||
Given("ExperienceDeleteService 테스트") { | ||
When("삭제할 UUID가 주어지면") { | ||
val deleteId = UUID.randomUUID() | ||
every { experienceDeleteService.deleteExperienceById(deleteId) } returns Unit | ||
|
||
experienceDeleteService.deleteExperienceById(deleteId) | ||
|
||
Then("ExperienceRemover.remove가 호출된다.") { | ||
verify { experienceRemover.remove(deleteId) } | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../kotlin/com/bamyanggang/domainmodule/domain/experience/service/ExperienceContentReader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.bamyanggang.domainmodule.domain.experience.service | ||
|
||
import com.bamyanggang.domainmodule.domain.experience.aggregate.ExperienceContent | ||
import com.bamyanggang.domainmodule.domain.experience.repository.ExperienceContentRepository | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class ExperienceContentReader( | ||
private val experienceRepository: ExperienceContentRepository | ||
) { | ||
fun readByExperienceId(experienceId: UUID): List<ExperienceContent> { | ||
return experienceRepository.findByExperienceId(experienceId) | ||
} | ||
} |
Oops, something went wrong.