@TestFactory
Stream<DynamicTest> report(MockServerClient client) throws ReflectiveOperationException {

    client
        .when(request()
            .withPath("/stats")
            .withMethod("POST")
            .withContentType(MediaType.APPLICATION_JSON_UTF_8))
        .respond(response()
            .withStatusCode(200));
    setStaticFinalField(Statistics.class, "PING_URL", "http://localhost:" + MOCK_SERVER_PORT + "/stats");
    final Project project = mock(Project.class);
    when(project.getAppId()).thenReturn("app-id");
    final InfoComponent infoComponent = mock(InfoComponent.class);
    when(infoComponent.getTitle()).thenReturn("title");
    when(infoComponent.getImplementationVersion()).thenReturn("3.2.9");
    final ProjectComponent projectComponent = mock(ProjectComponent.class);
    when(projectComponent.getProject()).thenReturn(project);
    return Arrays.stream(Event.values()).map(event -> dynamicTest(event.name(), () -> {
        when(project.dbmses()).thenReturn(Stream.empty());
        assertDoesNotThrow(() -> Statistics.report(infoComponent, projectComponent, event));
    }));
}