Skip to content

Commit b20087d

Browse files
committed
fix: 리베이스 오류 해결
1 parent 2f8611a commit b20087d

File tree

6 files changed

+7
-27
lines changed

6 files changed

+7
-27
lines changed

src/main/java/com/somemore/domains/notification/service/NotificationCommandService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void markMultipleNotificationsAsRead(UUID userId, NotificationIdsRequestD
3838

3939
notifications.forEach(notification ->
4040
validateNotificationOwnership(userId, notification.getReceiverId()));
41+
4142
notifications.forEach(Notification::markAsRead);
4243
}
4344

src/main/java/com/somemore/domains/notification/service/NotificationQueryService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ public List<NotificationResponseDto> getReadNotifications(UUID userId) {
5454
.toList();
5555
return NotificationResponseDto.from(notifications);
5656
}
57-
}
57+
}

src/main/java/com/somemore/domains/notification/usecase/NotificationQueryUseCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public interface NotificationQueryUseCase {
1717
List<NotificationResponseDto> getUnreadNotifications(UUID userId);
1818

1919
List<NotificationResponseDto> getReadNotifications(UUID userId);
20-
}
20+
}

src/test/java/com/somemore/domains/notification/handler/NotificationHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void handle() {
8383
notificationHandler.handle(notification);
8484

8585
// then
86-
List<Notification> notifications = notificationRepository.findByReceiverIdAndUnread(volunteerUser.getId());
86+
List<Notification> notifications = notificationRepository.findAllByUserId(volunteerUser.getId());
8787
assertThat(notifications).hasSize(1);
8888

8989
Notification savedNotification = notifications.getFirst();

src/test/java/com/somemore/domains/notification/repository/NotificationRepositoryTest.java

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,36 +42,14 @@ void setup() {
4242
}
4343
}
4444

45-
@DisplayName("사용자의 읽지 않은 알림을 조회한다.")
46-
@Test
47-
void findByReceiverIdAndUnread() {
48-
// when
49-
List<Notification> notifications = notificationRepository.findByReceiverIdAndUnread(receiverId);
50-
51-
// then
52-
assertThat(notifications).hasSize(10);
53-
assertThat(notifications.getFirst().isRead()).isFalse();
54-
}
55-
56-
@DisplayName("사용자의 읽은 알림을 조회한다.")
57-
@Test
58-
void findByReceiverIdAndRead() {
59-
// when
60-
List<Notification> notifications = notificationRepository.findByReceiverIdAndRead(receiverId);
61-
62-
// then
63-
assertThat(notifications).hasSize(10);
64-
assertThat(notifications.getFirst().isRead()).isTrue();
65-
}
66-
6745
@DisplayName("알림이 없는 사용자의 읽지 않은 알림을 조회하면 빈 리스트를 반환한다.")
6846
@Test
6947
void findByReceiverIdAndUnread_noNotifications() {
7048
// given
7149
UUID unknownReceiverId = UUID.randomUUID();
7250

7351
// when
74-
List<Notification> notifications = notificationRepository.findByReceiverIdAndUnread(unknownReceiverId);
52+
List<Notification> notifications = notificationRepository.findAllByUserId(unknownReceiverId);
7553

7654
// then
7755
assertThat(notifications).isEmpty();

src/test/java/com/somemore/domains/notification/service/NotificationCommandServiceTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.somemore.domains.notification.dto.NotificationIdsRequestDto;
66
import com.somemore.domains.notification.repository.NotificationRepository;
77
import com.somemore.global.exception.BadRequestException;
8+
import com.somemore.global.exception.NoSuchElementException;
89
import com.somemore.support.IntegrationTestSupport;
910
import org.junit.jupiter.api.DisplayName;
1011
import org.junit.jupiter.api.Test;
@@ -53,7 +54,7 @@ void markSingleNotificationAsReadWhenNotificationNotExists() {
5354

5455
// when / then
5556
assertThatThrownBy(() -> notificationCommandService.markSingleNotificationAsRead(receiverId, nonExistentNotificationId))
56-
.isInstanceOf(BadRequestException.class)
57+
.isInstanceOf(NoSuchElementException.class)
5758
.hasMessageContaining(NOT_EXISTS_NOTIFICATION.getMessage());
5859
}
5960

0 commit comments

Comments
 (0)