Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-340] 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW committed Apr 22, 2024
1 parent 00dd6b7 commit 2ccfd9e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.studentcenter.weave.application.suggestion.port.inbound

import com.studentcenter.weave.application.user.vo.UserAuthentication
import java.util.*

interface CreateSuggestion {

fun invoke(command: Command)

data class Command(
val userAuthentication: UserAuthentication,
val userId: UUID,
val contents: String,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CreateSuggestionService(

override fun invoke(command: CreateSuggestion.Command) {
Suggestion.create(
userId = command.userAuthentication.userId,
userId = command.userId,
contents = command.contents
).also {
suggestionRepository.save(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.studentcenter.weave.application.suggestion.service

import com.studentcenter.weave.application.suggestion.outbound.SuggestionRepositorySpy
import com.studentcenter.weave.application.suggestion.port.inbound.CreateSuggestion
import com.studentcenter.weave.application.user.vo.UserAuthenticationFixtureFactory
import com.studentcenter.weave.domain.user.entity.UserFixtureFactory
import io.kotest.core.annotation.DisplayName
import io.kotest.core.spec.style.DescribeSpec
Expand All @@ -22,10 +21,9 @@ class CreateSuggestionServiceTest : DescribeSpec({
it("제안을 생성하고 DB에 저장한다") {
// arrange
val userFixture = UserFixtureFactory.create()
val userAuthentication = UserAuthenticationFixtureFactory.create(userFixture)

val command = CreateSuggestion.Command(
userAuthentication = userAuthentication,
userId = userFixture.id,
contents = "contents"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class SuggestionCreateRequest(
}

return CreateSuggestion.Command(
userAuthentication = userAuth,
userId = userAuth.userId,
contents = contents
)
}
Expand Down

0 comments on commit 2ccfd9e

Please sign in to comment.