Skip to content

Commit

Permalink
Merge pull request #44 from elwyncrestha/test/view-notifications
Browse files Browse the repository at this point in the history
Feature: Added test for notification repository.
  • Loading branch information
elwyncrestha authored Jul 23, 2020
2 parents 84f0ae2 + c3a5b2e commit d764ee7
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.pemits.webcare.api.notification.repository;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
Expand Down Expand Up @@ -120,4 +121,19 @@ public void testSaveShouldUpdateNotification() {
assertThat(saved.getStatus(), not(oldStatus));
assertThat(saved.getStatus(), is(newStatus));
}

@Test
@DatabaseSetup("/dataset/department/department-config.xml")
@DatabaseSetup({
"/dataset/user/users-of-type-doctor.xml",
"/dataset/user/users-of-type-patient.xml"
})
@DatabaseSetup("/dataset/doctor/doctor-config.xml")
@DatabaseSetup("/dataset/patient/patient-config.xml")
@DatabaseSetup("/dataset/notification/notification-config.xml")
public void testFindAllShouldReturnNotEmptyList() {
final List<Notification> notifications = repository.findAll();

assertThat(notifications.size(), greaterThan(0));
}
}

0 comments on commit d764ee7

Please sign in to comment.