### Question:
LogApiService { @PreAuthorize("hasRole('ADMIN')") public LogPagination filter(final LogFilter logFilter) { return logManager.filter(logFilter); }  @PreAuthorize("hasRole('ADMIN')") LogPagination filter(final LogFilter logFilter); @PreAuthorize("hasRole('ADMIN')") LogFilter getFilters();  }### Answer:
@Test @WithMockUser(roles = ADMIN_ROLE) public void shouldAllowAccessToLogPaginationForAdmin() { doReturn(logPagination).when(mockLogManager).filter(logFilter); assertThat(logApiService.filter(logFilter)).isEqualTo(logPagination); }
@Test(expected = AccessDeniedException.class) @WithMockUser(roles = SIMPLE_USER_ROLE) public void shouldDenyAccessToLogPaginationForNotAdmin() { doReturn(logPagination).when(mockLogManager).filter(logFilter); logApiService.filter(logFilter); }