-
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 #106 from KUSITMS-29th-TEAM-B/feat/flight-100
feat : JD 삭제 API 구현
- Loading branch information
Showing
12 changed files
with
139 additions
and
2 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
18 changes: 18 additions & 0 deletions
18
...nggang/apimodule/domain/jobDescription/application/service/JobDescriptionDeleteService.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,18 @@ | ||
package com.bamyanggang.apimodule.domain.jobDescription.application.service | ||
|
||
import com.bamyanggang.domainmodule.domain.jobDescription.service.JobDescriptionRemover | ||
import org.springframework.stereotype.Service | ||
import org.springframework.transaction.annotation.Transactional | ||
import java.util.* | ||
|
||
@Service | ||
class JobDescriptionDeleteService( | ||
private val jobDescriptionRemover: JobDescriptionRemover | ||
) { | ||
|
||
@Transactional | ||
fun deleteJobDescription(jobDescriptionId: UUID) { | ||
jobDescriptionRemover.removeJobDescription(jobDescriptionId) | ||
} | ||
|
||
} |
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
24 changes: 24 additions & 0 deletions
24
...amyanggang/apimodule/domain/jobDescription/application/JobDescriptionDeleteServiceTest.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,24 @@ | ||
package com.bamyanggang.apimodule.domain.jobDescription.application | ||
|
||
import com.bamyanggang.apimodule.domain.jobDescription.application.service.JobDescriptionDeleteService | ||
import com.bamyanggang.domainmodule.domain.jobDescription.service.JobDescriptionRemover | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.* | ||
|
||
class JobDescriptionDeleteServiceTest: BehaviorSpec({ | ||
val jobRemover = mockk<JobDescriptionRemover>(relaxed = true) | ||
val jobDescriptionDeleteService = JobDescriptionDeleteService(jobRemover) | ||
|
||
given("JobDescriptionDeleteService.deleteJobDescription") { | ||
val jobDescriptionId = UUID.randomUUID() | ||
`when`("jobDescriptionId가 주어지면") { | ||
jobDescriptionDeleteService.deleteJobDescription(jobDescriptionId) | ||
then("removeJobDescription가 호출된다.") { | ||
verify { jobRemover.removeJobDescription(jobDescriptionId) } | ||
} | ||
} | ||
} | ||
|
||
}) |
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
...otlin/com/bamyanggang/domainmodule/domain/jobDescription/service/JobDescriptionRemover.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.domainmodule.domain.jobDescription.service | ||
|
||
import com.bamyanggang.domainmodule.domain.jobDescription.repository.JobDescriptionRepository | ||
import org.springframework.stereotype.Service | ||
import java.util.* | ||
|
||
@Service | ||
class JobDescriptionRemover( | ||
private val jobDescriptionRepository: JobDescriptionRepository | ||
) { | ||
|
||
fun removeJobDescription(jobDescriptionId: UUID) { | ||
jobDescriptionRepository.deleteById(jobDescriptionId) | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...n/com/bamyanggang/domainmodule/domain/jobDescription/service/JobDescriptionRemoverTest.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,25 @@ | ||
package com.bamyanggang.domainmodule.domain.jobDescription.service | ||
|
||
import com.bamyanggang.domainmodule.domain.jobDescription.repository.JobDescriptionRepository | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.mockk.mockk | ||
import io.mockk.verify | ||
import java.util.* | ||
|
||
class JobDescriptionRemoverTest: BehaviorSpec({ | ||
val jobDescriptionRepository = mockk<JobDescriptionRepository>(relaxed = true) | ||
val service = JobDescriptionRemover(jobDescriptionRepository) | ||
|
||
given("JobDescriptionRemover.removeJobDescription") { | ||
val jobDescriptionId: UUID = UUID.randomUUID() | ||
`when`("jobDescriptionId가 주어지면") { | ||
service.removeJobDescription(jobDescriptionId) | ||
then("removeJobDescription가 호출된다.") { | ||
verify { | ||
jobDescriptionRepository.deleteById(jobDescriptionId) | ||
} | ||
} | ||
} | ||
} | ||
|
||
}) |
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