File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
main/kotlin/com/devooks/backend/notification/v1/adapter/in
test/kotlin/com/devooks/backend/notification/v1/adapter/in/http Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
package com.devooks.backend.notification.v1.adapter.`in`.dto
2
2
3
+ import io.swagger.v3.oas.annotations.media.Schema
4
+
3
5
data class CheckNotificationResponse (
4
- val count : Int ,
6
+ @Schema(description = " 확인하지 않은 알림 개수" )
7
+ val countOfUncheckedNotification : Int ,
5
8
)
Original file line number Diff line number Diff line change @@ -73,8 +73,9 @@ class NotificationRouter(
73
73
): CheckNotificationResponse {
74
74
val memberId = tokenService.getMemberId(Authorization (authorization))
75
75
val request = CheckNotificationsRequest (memberId, notificationId)
76
- val size: Int = modifyNotificationUseCase.check(request)
77
- return CheckNotificationResponse (size)
76
+ modifyNotificationUseCase.check(request)
77
+ val count = getNotificationUseCase.getCountOfUnchecked(memberId)
78
+ return CheckNotificationResponse (count)
78
79
}
79
80
80
81
private suspend fun getCountOfUncheckedNotifications (memberId : UUID ): ServerSentEvent <StreamCountResponse > {
Original file line number Diff line number Diff line change @@ -125,10 +125,10 @@ internal class NotificationRouterTest @Autowired constructor(
125
125
.expectBody<CheckNotificationResponse >()
126
126
.returnResult()
127
127
.responseBody!!
128
- .count
128
+ .countOfUncheckedNotification
129
129
130
130
// then
131
- assertThat(count).isOne ()
131
+ assertThat(count).isZero ()
132
132
}
133
133
134
134
@Test
@@ -147,9 +147,9 @@ internal class NotificationRouterTest @Autowired constructor(
147
147
.expectBody<CheckNotificationResponse >()
148
148
.returnResult()
149
149
.responseBody!!
150
- .count
150
+ .countOfUncheckedNotification
151
151
152
152
// then
153
- assertThat(count).isOne ()
153
+ assertThat(count).isZero ()
154
154
}
155
155
}
You can’t perform that action at this time.
0 commit comments