Skip to content

Commit

Permalink
refactor: 스펙 변경 및 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kpeel5839 committed Aug 28, 2024
1 parent 9964b29 commit 5d1ccc4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ class InquiryNotificationServiceTest @Autowired constructor(
// then
responses1.notifications.size shouldBe 1
responses1.notifications[0].id shouldBe savedNotification.id
responses1.notifications[0].userId shouldBe user.id
responses1.lastCursorId shouldBe savedNotification.id
responses1.hasNext shouldBe true
responses2.notifications.size shouldBe 1
responses2.notifications[0].id shouldBe notifications[0].id
responses2.notifications[0].userId shouldBe user.id
responses2.lastCursorId shouldBe notifications[0].id
responses2.hasNext shouldBe false
}
Expand Down Expand Up @@ -83,7 +85,9 @@ class InquiryNotificationServiceTest @Autowired constructor(
// then
actual.size shouldBe 2
actual[0].isNew shouldBe false
actual[0].userId shouldBe user.id
actual[1].isNew shouldBe true
actual[1].userId shouldBe user.id
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CheckedUserRestrictionServiceTest @Autowired constructor(

// then
response.restrictionType shouldBe RestrictionType.NONE
response.releaseDate shouldBe LocalDate.of(9999, 12, 31)
response.releaseDate shouldBe LocalDate.of(9999, 12, 31).toString()
}

@Test
Expand All @@ -53,7 +53,7 @@ class CheckedUserRestrictionServiceTest @Autowired constructor(

// then
response.restrictionType shouldBe RestrictionType.PERMANENT_BAN_MESSAGE_REPORT
response.releaseDate shouldBe LocalDate.of(9999, 12, 31)
response.releaseDate shouldBe LocalDate.of(9999, 12, 31).toString()
}

@Test
Expand All @@ -80,7 +80,7 @@ class CheckedUserRestrictionServiceTest @Autowired constructor(

// then
response.restrictionType shouldBe RestrictionType.PERMANENT_BAN_VOTE_REPORT
response.releaseDate shouldBe LocalDate.of(9999, 12, 31)
response.releaseDate shouldBe LocalDate.of(9999, 12, 31).toString()
}

@Test
Expand All @@ -104,7 +104,7 @@ class CheckedUserRestrictionServiceTest @Autowired constructor(

// then
response.restrictionType shouldBe RestrictionType.TEMPORARY_BAN_MESSAGE_REPORT
response.releaseDate shouldBe now.plusDays(30)
response.releaseDate shouldBe now.plusDays(30).toString()
}

@Test
Expand All @@ -128,7 +128,7 @@ class CheckedUserRestrictionServiceTest @Autowired constructor(

// then
response.restrictionType shouldBe RestrictionType.TEMPORARY_BAN_MESSAGE_REPORT
response.releaseDate shouldBe now.plusDays(90)
response.releaseDate shouldBe now.plusDays(90).toString()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.wespot.notification.Notification
data class NotificationResponse(
val id: Long,
val type: String,
val date: String,
val userId: Long,
val targetId: Long,
val content: String,
val isNew: Boolean,
Expand All @@ -19,7 +19,7 @@ data class NotificationResponse(
return NotificationResponse(
id = notification.id,
type = notification.type.name,
date = notification.date.toString(),
userId = notification.userId,
targetId = notification.targetId,
content = notification.title,
isNew = !notification.isRead,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import java.time.LocalDate

data class CheckedRestrictionResponse(
val restrictionType: RestrictionType,
val releaseDate: LocalDate,
val releaseDate: String,
) {
companion object {
fun from(userRestriction: Pair<RestrictionType, LocalDate>): CheckedRestrictionResponse {
return CheckedRestrictionResponse(
restrictionType = userRestriction.first,
releaseDate = userRestriction.second
releaseDate = userRestriction.second.toString()
)
}
}
Expand Down

0 comments on commit 5d1ccc4

Please sign in to comment.