Skip to content

Commit 3a6b377

Browse files
committed
passing tests
1 parent 70bda2f commit 3a6b377

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/test/java/controller/NoteControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void setUp() {
8383
when(noteRepo.findOne(any(Long.class))).thenReturn(TEST_NOTE1);
8484
when(noteRepo.create(any(Note.class), any(Credentials.class))).thenReturn(TEST_NOTE1);
8585
when(noteRepo.update(any(Note.class))).thenReturn(TEST_MODIFIED_NOTE);
86-
when(serviceRepo.getOne(any(Long.class))).thenReturn(TEST_SERVICE);
86+
when(serviceRepo.findOne(any(Long.class))).thenReturn(TEST_SERVICE);
8787
doNothing().when(noteRepo).delete(any(Note.class));
8888
doNothing().when(noteRepo).delete(any(Note.class));
8989
}

src/test/java/controller/NotificationControllerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public class NotificationControllerTest {
6868
@Before
6969
public void setUp() {
7070
MockitoAnnotations.initMocks(this);
71-
72-
when(notificationRepo.findAll()).thenReturn(mockNotificationList);
71+
when(notificationRepo.findAllByOrderByIdDesc()).thenReturn(mockNotificationList);
7372
when(notificationRepo.findOne(any(Long.class))).thenReturn(TEST_NOTIFICATION1);
7473
when(notificationRepo.create(any(Notification.class))).thenReturn(TEST_NOTIFICATION1);
7574
when(notificationRepo.update(any(Notification.class))).thenReturn(TEST_MODIFIED_NOTIFICATION);

src/test/java/controller/ServiceControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void setUp() {
8181
when(credentials.getUin()).thenReturn("123456789");
8282
when(userRepo.findByUin(any(String.class))).thenReturn(user);
8383
when(systemMonitorService.getOverallStatus()).thenReturn(new OverallStatus(edu.tamu.app.enums.OverallMessageType.SUCCESS, "Success"));
84-
when(serviceRepo.findAll()).thenReturn(mockServiceList);
84+
when(serviceRepo.findAllByOrderByIdDesc()).thenReturn(mockServiceList);
8585
when(serviceRepo.findByIsPublicOrderByIdDesc(true)).thenReturn(mockPublicServiceList);
8686
when(serviceRepo.findOne(any(Long.class))).thenReturn(TEST_SERVICE1);
8787
when(serviceRepo.create(any(Service.class))).thenReturn(TEST_SERVICE1);

0 commit comments

Comments
 (0)