From 82cfed3771640d32c726b146f074bce53d80131c Mon Sep 17 00:00:00 2001 From: jjuny7712 Date: Fri, 10 Nov 2023 17:15:01 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EC=83=88=EB=A1=9C=EC=9A=B4=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=20=ED=99=95=EC=9D=B8=20Controller=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NotificationControllerTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java b/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java index 7df051d2..995479da 100644 --- a/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java +++ b/src/test/java/com/ssafy/ssafsound/domain/notification/controller/NotificationControllerTest.java @@ -1,5 +1,6 @@ package com.ssafy.ssafsound.domain.notification.controller; +import com.ssafy.ssafsound.domain.notification.dto.GetCheckNotificationResDto; import com.ssafy.ssafsound.domain.notification.dto.GetNotificationResDto; import com.ssafy.ssafsound.global.docs.ControllerTest; import com.ssafy.ssafsound.global.util.fixture.NotificationFixture; @@ -58,4 +59,24 @@ void getNotificationsByCursor() { ) ); } + + @Test + @DisplayName("새로운 알림 확인") + void checkNewNotification() { + doReturn(new GetCheckNotificationResDto(true)) + .when(notificationService) + .checkNotification(any()); + + restDocs.cookie(ACCESS_TOKEN) + .when().get("/notifications/new") + .then().log().all() + .statusCode(HttpStatus.OK.value()) + .apply(document("notification/check-new_notification", + requestCookieAccessTokenMandatory(), + getEnvelopPatternWithData().andWithPrefix("data.", + fieldWithPath("isNew").type(JsonFieldType.BOOLEAN).description("새로운 알림이 있는지 여부, true면 확인하지 않은 알림이 있다는 의미.") + ) + ) + ); + } } \ No newline at end of file