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