Skip to content

Commit b5f8873

Browse files
committed
Updated tests
1 parent 3a7c856 commit b5f8873

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/test/java/controller/NotificationControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void setUp() {
6868
when(notificationRepo.findAll()).thenReturn(mockNotificationList);
6969
when(notificationRepo.findOne(any(Long.class))).thenReturn(TEST_NOTIFICATION1);
7070
when(notificationRepo.create(any(String.class), any(String.class), any(boolean.class), anyListOf(NotificationLocation.class))).thenReturn(TEST_NOTIFICATION1);
71-
when(notificationRepo.save(any(Notification.class))).thenReturn(TEST_MODIFIED_NOTIFICATION);
71+
when(notificationRepo.update(any(Notification.class))).thenReturn(TEST_MODIFIED_NOTIFICATION);
7272
doNothing().when(notificationRepo).delete(any(Notification.class));
7373
}
7474

src/test/java/edu/tamu/app/model/NotificationTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import java.util.Arrays;
66
import java.util.List;
77

8-
import javax.validation.ConstraintViolationException;
9-
108
import org.junit.After;
119
import org.junit.Test;
1210
import org.junit.runner.RunWith;
@@ -65,7 +63,7 @@ public void testUpdateName() {
6563
public void testUpdateBody() {
6664
Notification notification = notificationRepo.create(TEST_NOTIFICATION_NAME, TEST_NOTIFICATION_BODY, TEST_IS_ACTIVE, TEST_LOCATIONS);
6765
notification.setBody(TEST_ALTERNATE_NOTIFICATION_BODY);
68-
notificationRepo.save(notification);
66+
notificationRepo.update(notification);
6967
notification = notificationRepo.findOne(notification.getId());
7068
assertEquals("Notification body was not changed", TEST_ALTERNATE_NOTIFICATION_BODY, notification.getBody());
7169
}

0 commit comments

Comments
 (0)