@Test
@DatabaseSetup("HibernateMedicationsDaoTest.testLoadMedicationsMap.xml")
public void testGetMedicationDataMap()
{

  final Map<Long, MedicationHolderDto> medicationsMap =
      medicationsDao.loadMedicationsMap(new DateTime(2016, 6, 12, 0, 0, 0));
  assertEquals(1, medicationsMap.size());
  final MedicationHolderDto dto = medicationsMap.get(1L);
  assertEquals(1L, (long)dto.getId());
  assertEquals("Lekadol", dto.getName());
  assertEquals("Lek", dto.getShortName());
  assertEquals("Paracetamol", dto.getGenericName());
  assertEquals(MedicationLevelEnum.VTM, dto.getMedicationLevel());
  assertEquals(1L, (long)dto.getVtmId());
  assertNull(dto.getVmpId());
  assertNull(dto.getAmpId());
  assertEquals(1L, dto.getDoseFormDto().getId());
  assertEquals("Pill", dto.getDoseFormDto().getName());
  assertEquals("C1", dto.getAtcGroupCode());
  assertEquals("ATC 1", dto.getAtcGroupName());
  assertEquals(1L, dto.getDefiningIngredient().getId());
  assertEquals("Paracetamol", dto.getDefiningIngredient().getIngredientName());
  assertEquals(Double.valueOf(2.0), dto.getDefiningIngredient().getStrengthNumerator());
  assertEquals("mg", dto.getDefiningIngredient().getStrengthNumeratorUnit());
  assertEquals(MedicationTypeEnum.MEDICATION, dto.getMedicationType());
  assertEquals(MedicationRuleEnum.PARACETAMOL_MAX_DAILY_DOSE, dto.getMedicationRules().iterator().next());
  assertTrue(dto.getFormularyCareProviders().contains("CP1"));
  assertTrue(dto.getFormularyCareProviders().contains("CP2"));
  assertTrue(dto.isActive());
  assertFalse(dto.isAntibiotic());
  assertTrue(dto.isFormulary());
  assertTrue(dto.isInpatientMedication());
  assertTrue(dto.isOutpatientMedication());
  assertFalse(dto.isSuggestSwitchToOral());
  assertFalse(dto.isMentalHealthDrug());
  assertTrue(dto.isOrderable());
  assertFalse(dto.isReviewReminder());
}