@@ -0,0 +1,2669 @@
+/*%0A * Copyright (c) 2018 Redlink GmbH.%0A */%0Apackage com.rbmhtechnology.vind.monitoring.report;%0A%0Aimport com.rbmhtechnology.vind.monitoring.report.writer.HtmlReportWriter;%0Aimport org.junit.*;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.time.ZonedDateTime;%0Aimport java.util.ArrayList;%0Aimport java.util.LinkedHashMap;%0A%0A/**%0A * Created on 08.06.18.%0A */%0Apublic class createReportIT %7B%0A%0A    private String esHost = %22localhost%22;%0A    private String esPort = %229200%22;%0A    private String esIndex = %22logAnalysis%22;%0A    private String applicationName = %22App name%22;%0A    private final String messageWrapper = %22message_json%22;%0A    private ElasticSearchReportService esRepsortService;%0A%0A    private Report report;%0A    private HtmlReportWriter reportWriter =  new HtmlReportWriter();%0A    private File reportFile;%0A%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        final ZonedDateTime from = ZonedDateTime.now().minusYears(1);%0A        final ZonedDateTime to = ZonedDateTime.now().plusYears(1);%0A%0A        esRepsortService = new ElasticSearchReportService(esHost, esPort, esIndex, from, to, applicationName);%0A        esRepsortService.setMessageWrapper(messageWrapper);%0A%0A        final LinkedHashMap%3CString, Long%3E topFaceFields = esRepsortService.getTopFaceFields();%0A        final ArrayList%3CString%3E facetFields = new ArrayList%3C%3E(topFaceFields.keySet());%0A%0A        final LinkedHashMap%3CString, Long%3E topSuggestionFields = esRepsortService.getTopSuggestionFields();%0A        final ArrayList%3CString%3E suggestFields = new ArrayList%3C%3E(topSuggestionFields.keySet());%0A%0A        this.report = new Report()%0A                .setApplicationName(applicationName)%0A                .setFrom(from)%0A                .setTo(to)%0A                .setTopDays(esRepsortService.getTopDays())%0A                .setRequests(esRepsortService.getTotalRequests())%0A                .setTopSuggestionFields(topSuggestionFields)%0A                .setSuggestionFieldsValues(esRepsortService.getSuggestionFieldsValues(suggestFields))%0A                .setFacetFieldsValues(esRepsortService.getFacetFieldsValues(facetFields))%0A                .setTopFacetFields(topFaceFields)%0A                .setTopQueries(esRepsortService.getTopQueries())%0A                .setTopUsers(esRepsortService.getTopUsers());%0A%0A        reportFile = File.createTempFile(%22reportTest%22, %22.html%22);%0A    %7D%0A%0A    @Test%0A    @Ignore%0A    public void createReportIT() %7B%0A%0A        Assert.assertTrue(reportWriter.write(this.report,reportFile.getAbsolutePath()));%0A%0A    %7D%0A%0A    @After%0A    public void cleanUp() throws Exception %7B%0A        esRepsortService.close();%0A%0A        if (reportFile.exists()) %7B%0A            reportFile.delete();%0A        %7D%0A    %7D%0A%0A%0A%7D%0A

Create integration test show how to create a report.