@Test public void shouldReturnFalseIfUserDoesNotHaveReportingRight() { Long userId = 1L; when(rightMapper.totalReportingRightsFor(userId)).thenReturn(0); assertThat(rightRepository.hasReportingRight(userId), is(false)); verify(rightMapper).totalReportingRightsFor(userId); }
public Boolean hasReportingRight(Long userId) { return rightsMapper.totalReportingRightsFor(userId) > 0; }
RightRepository { public Boolean hasReportingRight(Long userId) { return rightsMapper.totalReportingRightsFor(userId) > 0; } }
RightRepository { public Boolean hasReportingRight(Long userId) { return rightsMapper.totalReportingRightsFor(userId) > 0; }  }
RightRepository { public Boolean hasReportingRight(Long userId) { return rightsMapper.totalReportingRightsFor(userId) > 0; }  void insertRight(Right right); Boolean hasReportingRight(Long userId); List<Right> getAll(); }
RightRepository { public Boolean hasReportingRight(Long userId) { return rightsMapper.totalReportingRightsFor(userId) > 0; }  void insertRight(Right right); Boolean hasReportingRight(Long userId); List<Right> getAll();  }