@Test public void shouldGetAllDeliveryZonesForAUser() throws Exception { List<DeliveryZone> deliveryZones = new ArrayList<>(); when(mapper.getByUserForRight(1l, MANAGE_DISTRIBUTION)).thenReturn(deliveryZones); List<DeliveryZone> returnedZones = repository.getByUserForRight(1l, MANAGE_DISTRIBUTION); verify(mapper).getByUserForRight(1l, MANAGE_DISTRIBUTION); assertThat(returnedZones, is(deliveryZones)); }
public List<DeliveryZone> getByUserForRight(Long userId, String rightName) { return mapper.getByUserForRight(userId, rightName); }
DeliveryZoneRepository { public List<DeliveryZone> getByUserForRight(Long userId, String rightName) { return mapper.getByUserForRight(userId, rightName); } }
DeliveryZoneRepository { public List<DeliveryZone> getByUserForRight(Long userId, String rightName) { return mapper.getByUserForRight(userId, rightName); }  }
DeliveryZoneRepository { public List<DeliveryZone> getByUserForRight(Long userId, String rightName) { return mapper.getByUserForRight(userId, rightName); }  void insert(DeliveryZone zone); void update(DeliveryZone zone); DeliveryZone getByCode(String code); List<DeliveryZone> getByUserForRight(Long userId, String rightName); List<Program> getPrograms(Long id); DeliveryZone getById(Long id); List<DeliveryZone> getAll(); }
DeliveryZoneRepository { public List<DeliveryZone> getByUserForRight(Long userId, String rightName) { return mapper.getByUserForRight(userId, rightName); }  void insert(DeliveryZone zone); void update(DeliveryZone zone); DeliveryZone getByCode(String code); List<DeliveryZone> getByUserForRight(Long userId, String rightName); List<Program> getPrograms(Long id); DeliveryZone getById(Long id); List<DeliveryZone> getAll();  }