### Question:
AuditEventService extends AbstractService { public PageBrowser<AuditEvent> listAuditEvents(final String domainId) { return listAuditEvents(domainId, new AuditEventPageRequest()); } AuditEventService(final RestTemplate restTemplate, final AccountService accountService, final GoodDataSettings settings); PageBrowser<AuditEvent> listAuditEvents(final String domainId); PageBrowser<AuditEvent> listAuditEvents(final String domainId, final PageRequest page); PageBrowser<AuditEvent> listAuditEvents(final Account account); PageBrowser<AuditEvent> listAuditEvents(final Account account, final PageRequest page); PageBrowser<AuditEvent> listAuditEvents(); PageBrowser<AuditEvent> listAuditEvents(final PageRequest page); static final UriTemplate ADMIN_URI_TEMPLATE; static final UriTemplate USER_URI_TEMPLATE; }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*account.*") public void shouldFailOnNullAccount() throws Exception { service.listAuditEvents((Account) null); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*account.*") public void shouldFailOnNullAccountButPage() throws Exception { service.listAuditEvents((Account) null, new CustomPageRequest()); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*account.id.*") public void shouldFailOnNullAccountIdButPage() throws Exception { service.listAuditEvents(mock(Account.class), new CustomPageRequest()); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*page.*") public void shouldFailOnNullPageButAccount() throws Exception { final Account account = mock(Account.class); when(account.getId()).thenReturn("123"); service.listAuditEvents(account, null); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*domain.*") public void shouldFailOnNullDomain() throws Exception { service.listAuditEvents((String) null); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*domain.*") public void shouldFailOnNullDomainButPage() throws Exception { service.listAuditEvents((String) null, new CustomPageRequest()); }
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*domain.*") public void shouldFailOnNullPageButDomain() throws Exception { service.listAuditEvents("", null); }