Source:
<code>private void testStarredOrganizationEvents(OrganizationsApi organizationsApiUser2, Organization organization) { organizationsApiUser2.starOrganization(organization.getId(), SwaggerUtility.createStarRequest(true)); final io.dockstore.openapi.client.ApiClient openAPIWebClientUser2 = getOpenAPIWebClient(USER_2_USERNAME, testingPostgres); EventsApi eventsApi = new EventsApi(openAPIWebClientUser2); List<io.dockstore.openapi.client.model.Event> events = eventsApi .getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), null, null); <START> Assert.assertEquals("Should have 1 create, 1 approve, 4 modify events", 6, events.size()); <END> events = eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), 5, null); Assert.assertEquals("Should have 1 create, 1 approve, 4 modify events", 5, events.size()); try { eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), EventDAO.MAX_LIMIT + 1, 0); Assert.fail("Should've failed because it's over the limit"); } catch (io.dockstore.openapi.client.ApiException e) { Assert.assertEquals("{\"errors\":[\"query param limit must be less than or equal to " + EventDAO.MAX_LIMIT + "\"]}", e.getMessage()); } try { eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), 0, 0); Assert.fail("Should've failed because it's under the limit"); } catch (io.dockstore.openapi.client.ApiException e) { Assert.assertEquals("{\"errors\":[\"query param limit must be greater than or equal to 1\"]}", e.getMessage()); } }</code><technical_language>A bit misleading, test checks 6 events in general. idea lines</technical_language>

Target:
private void testStarredOrganizationEvents(OrganizationsApi organizationsApiUser2, Organization organization) { organizationsApiUser2.starOrganization(organization.getId(), SwaggerUtility.createStarRequest(true)); final io.dockstore.openapi.client.ApiClient openAPIWebClientUser2 = getOpenAPIWebClient(USER_2_USERNAME, testingPostgres); EventsApi eventsApi = new EventsApi(openAPIWebClientUser2); List<io.dockstore.openapi.client.model.Event> events = eventsApi .getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), null, null); Assert.assertEquals("Should have the correct amount of events", 6, events.size()); events = eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), 5, null); Assert.assertEquals("Should have the correct amount of events", 5, events.size()); Assert.assertFalse("The create org event is the oldest, it should not be returned", events.stream().anyMatch(event -> event.getType().equals(io.dockstore.openapi.client.model.Event.TypeEnum.CREATE_ORG))); try { eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), EventDAO.MAX_LIMIT + 1, 0); Assert.fail("Should've failed because it's over the limit"); } catch (io.dockstore.openapi.client.ApiException e) { Assert.assertEquals("{\"errors\":[\"query param limit must be less than or equal to " + EventDAO.MAX_LIMIT + "\"]}", e.getMessage()); } try { eventsApi.getEvents(EventSearchType.STARRED_ORGANIZATION.toString(), 0, 0); Assert.fail("Should've failed because it's under the limit"); } catch (io.dockstore.openapi.client.ApiException e) { Assert.assertEquals("{\"errors\":[\"query param limit must be greater than or equal to 1\"]}", e.getMessage()); } }