@Test
public void testGetAdministrationTaskForBarcodeByTherapyId()
{

  Mockito
      .when(medicationsDao.getMedicationIdForBarcode("123e4567-e89b-12d3-a456-426655440001|Medication instruction"))
      .thenReturn(null);
  Mockito
      .when(medicationsBo.getOriginalTherapyId(
          "1",
          "123e4567-e89b-12d3-a456-426655440000"))
      .thenReturn("123e4567-e89b-12d3-a456-426655440001|Medication instruction");
  Mockito
      .when(medicationsTasksProvider.findAdministrationTasks(
          Collections.singleton("1"),
          testTime.minusHours(1),
          testTime.plusHours(1)))
      .thenReturn(Lists.newArrayList(buildTaskDto("333", "123e4567-e89b-12d3-a456-426655440000|Medication instruction")));
  final BarcodeTaskSearchDto dto = barcodeTaskFinder.getAdministrationTaskForBarcode(
      "1",
      "123e4567-e89b-12d3-a456-426655440001|Medication instruction",
      testTime);
  assertEquals(BarcodeSearchResult.TASK_FOUND, dto.getBarcodeSearchResult());
  assertEquals("333", dto.getTaskId());
  assertNull(dto.getMedicationId());
}