@Test
@DatabaseSetup("HibernateMedicationsDaoTest.testLoadMedicationWarnings.xml")
public void testGetMedicationWarnings()
{

  final Set<Long> medicationIds = new HashSet<>();
  medicationIds.add(1L);
  medicationIds.add(2L);
  final Collection<MedicationsWarningDto> customWarningsForMedication = medicationsDao.getCustomWarningsForMedication(
      medicationIds,
      DateTime.now());
  assertTrue(customWarningsForMedication.stream().anyMatch(
      w ->
      {
        final List<NamedExternalDto> medications = w.getMedications();
        return medications.stream().anyMatch(m -> "1".equals(m.getId())) && w.getSeverity() == WarningSeverity.SIGNIFICANT;
      }));
  assertTrue(customWarningsForMedication.stream().anyMatch(
      w ->
      {
        final List<NamedExternalDto> medications = w.getMedications();
        return medications.stream().anyMatch(m -> "2".equals(m.getId())) && w.getSeverity() == WarningSeverity.LOW;
      }));
}