@Test
public void testGetAdministrationTaskForBarcodeNoMatchingTherapy()
{

  Mockito
      .when(medicationsDao.getMedicationIdForBarcode("222"))
      .thenReturn(222L);
  Mockito
      .when(medicationsTasksProvider.findAdministrationTasks(
          Collections.singleton("1"),
          testTime.minusHours(1),
          testTime.plusHours(1)))
      .thenReturn(Lists.newArrayList(buildTaskDto("333", "uid1|Medication instruction")));
  Mockito
      .when(medicationsOpenEhrDao.getTherapyInstructionPairs(Sets.newHashSet("uid1")))
      .thenReturn(Lists.newArrayList(buildInstructionPair("uid1::1")));
  final BarcodeTaskSearchDto dto = barcodeTaskFinder.getAdministrationTaskForBarcode("1", "222", testTime);
  assertEquals(BarcodeSearchResult.NO_TASK, dto.getBarcodeSearchResult());
  assertNull(dto.getTaskId());
}