@Test
@DatabaseSetup("HibernateMedicationsDaoTest.testGetTherapyTemplates.xml")
public void testGetTherapyTemplates1()
{

  final TherapyTemplatesDto templatesDto =
      medicationsDao.getTherapyTemplates("555", "2", TherapyTemplateModeEnum.INPATIENT, "1", null, null, new Locale("en"));
  assertEquals(2L, (long)templatesDto.getUserTemplates().size());
  final TherapyTemplateDto firstUserTemplate = templatesDto.getUserTemplates().get(0);
  assertEquals(TherapyTemplateTypeEnum.USER, firstUserTemplate.getType());
  assertEquals("AAA", firstUserTemplate.getName());
  assertEquals("2", firstUserTemplate.getUserId());
  assertNull(firstUserTemplate.getCareProviderId());
  assertEquals(2L, (long)firstUserTemplate.getTemplateElements().size());
  assertTrue(firstUserTemplate.getTemplateElements().get(0).isCompleted());
  assertFalse(firstUserTemplate.getTemplateElements().get(1).isCompleted());
  final TherapyTemplateDto secondUserTemplate = templatesDto.getUserTemplates().get(1);
  assertEquals(TherapyTemplateTypeEnum.USER, secondUserTemplate.getType());
  assertEquals("BBB", secondUserTemplate.getName());
  assertEquals("2", secondUserTemplate.getUserId());
  assertNull(secondUserTemplate.getCareProviderId());
  assertEquals(1L, (long)secondUserTemplate.getTemplateElements().size());
  assertTrue(secondUserTemplate.getTemplateElements().get(0).isCompleted());
  assertEquals(1L, (long)templatesDto.getOrganizationTemplates().size());
  final TherapyTemplateDto organizationTemplate = templatesDto.getOrganizationTemplates().get(0);
  assertEquals(TherapyTemplateTypeEnum.ORGANIZATIONAL, organizationTemplate.getType());
  assertEquals("CCC", organizationTemplate.getName());
  assertNull(organizationTemplate.getUserId());
  assertEquals("1", organizationTemplate.getCareProviderId());
  assertEquals(1L, (long)organizationTemplate.getTemplateElements().size());
  assertTrue(organizationTemplate.getTemplateElements().get(0).isCompleted());
  assertEquals(0L, (long)templatesDto.getPatientTemplates().size());
}