@Test
void shouldWork() throws IOException {

    Category category = new Category()
            .setName(CATEGORY_NAME)
            .setMessageRegex(".*")
            .setMatchedStatuses(singletonList(Status.BROKEN));
    Map<String, Object> meta = new HashMap<>();
    meta.put("categories", singletonList(category));
    List<LaunchResults> launchResultsList = createSingleLaunchResults(
            meta, createTestResult("asd\n", Status.BROKEN)
    );
    CategoriesPlugin plugin = new CategoriesPlugin();
    plugin.aggregate(configuration, launchResultsList, reportPath);
    Set<TestResult> results = launchResultsList.get(0).getAllResults();
    List<Category> categories = results.toArray(new TestResult[]{})[0]
            .getExtraBlock("categories");
    assertThat(categories).as("test categories")
            .extracting(Category::getName)
            .containsExactly(category.getName());
    assertThat(reportPath.resolve("data").resolve(JSON_FILE_NAME))
            .exists();
    assertThat(reportPath.resolve("data").resolve(CSV_FILE_NAME))
            .exists();
}