@@ -70,7 +70,7 @@ void notifyBidSuccess() {
7070
7171 // Then
7272 verify (webSocketService , times (1 )).sendNotificationToUser (
73- eq (member .getId (). toString ()),
73+ eq (member .getEmail ()),
7474 contains ("입찰했습니다" ),
7575 any ()
7676 );
@@ -79,7 +79,7 @@ void notifyBidSuccess() {
7979 assertThat (notifications ).hasSize (1 );
8080
8181 Notification savedNotification = notifications .get (0 );
82- assertThat (savedNotification .getMember ().getId ()).isEqualTo (member .getId ());
82+ assertThat (savedNotification .getMember ().getEmail ()).isEqualTo (member .getEmail ());
8383 assertThat (savedNotification .getProduct ().getId ()).isEqualTo (product .getId ());
8484 assertThat (savedNotification .getNotificationType ()).isEqualTo ("BID_SUCCESS" );
8585 assertThat (savedNotification .getMessage ()).contains (product .getProductName ());
@@ -101,7 +101,7 @@ void notifyBidOutbid() {
101101
102102 // Then
103103 verify (webSocketService , times (1 )).sendNotificationToUser (
104- eq (member .getId (). toString ()),
104+ eq (member .getEmail ()),
105105 contains ("밀렸습니다" ),
106106 any ()
107107 );
@@ -127,7 +127,7 @@ void notifyAuctionWon() {
127127
128128 // Then
129129 verify (webSocketService , times (1 )).sendNotificationToUser (
130- eq (member .getId (). toString ()),
130+ eq (member .getEmail ()),
131131 contains ("낙찰받았습니다" ),
132132 any ()
133133 );
@@ -154,7 +154,7 @@ void notifyAuctionLost() {
154154
155155 // Then
156156 verify (webSocketService , times (1 )).sendNotificationToUser (
157- eq (member .getId (). toString ()),
157+ eq (member .getEmail ()),
158158 contains ("경매가 종료되었습니다" ),
159159 any ()
160160 );
@@ -178,7 +178,8 @@ void notifyWithInvalidUserId() {
178178 bidNotificationService .notifyBidSuccess (invalidUserId , product , bidAmount );
179179
180180 // Then
181- verify (webSocketService , times (1 )).sendNotificationToUser (any (), any (), any ());
181+ // member가 null이므로 sendNotificationToUser가 호출되지 않아야 함
182+ verify (webSocketService , times (0 )).sendNotificationToUser (any (), any (), any ());
182183
183184 List <Notification > notifications = notificationRepository .findAll ();
184185 assertThat (notifications ).isEmpty ();
0 commit comments