@Test public void test_findUserCards_for_maintainer() { Result<ComponentCard> archived = userFinder.findUserComponents(new UserId("user3"), new Range(0, 10)); assertThat(archived.getResult()).hasSize(10); assertThat(archived.getResult().get(0).getId()).isEqualTo("Component0"); }
@Test public void test_findUserCards_include_organisation() { Component component = MockBuilder.mock(888, State.PENDING, "@seedstack"); componentRepository.persist(component); Result<ComponentCard> archived = userFinder.findUserComponents(new UserId("admin"), new Range(0, 10)); assertThat(archived.getResult()).hasSize(1); assertThat(archived.getResult().get(0).getId()).isEqualTo("Component888"); componentRepository.delete(component); }
@Test public void test_findUserCards_retrieve_archived_component() { Component mock = MockBuilder.mock("Archived", 0, State.ARCHIVED, "user3"); componentRepository.persist(mock); Result<ComponentCard> archived = userFinder.findUserComponents(new UserId("user3"), new Range(0, 10)); assertThat(archived.getResult()).hasSize(10); assertThat(archived.getResult().get(0).getId()).isEqualTo("Archived0"); componentRepository.delete(mock); }