<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>tiger-test-lib</artifactId>
    <packaging>jar</packaging>

    <parent>
        <artifactId>tiger</artifactId>
        <groupId>de.gematik.test</groupId>
        <version>1.3.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <version.commons-collections4>4.4</version.commons-collections4>
        <version.jsonassert>1.5.1</version.jsonassert>
        <version.json-unit>2.36.1</version.json-unit>
        <version.xmlunit-core>2.9.1</version.xmlunit-core>

        <tiger.build.timestamp>${maven.build.timestamp}</tiger.build.timestamp>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
    </properties>

    <dependencies>
        <dependency>
            <groupId>de.gematik.test</groupId>
            <artifactId>tiger-testenv-mgr</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- serenity & cucumber -->
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-cucumber</artifactId>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-plugin</artifactId>
            <version>${version.cucumber}</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-core</artifactId>
            <version>${version.cucumber}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-model</artifactId>
            <version>${version.serenity.core}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-rest-assured</artifactId>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-screenplay</artifactId>
        </dependency>
        <!-- needed for java junit / testng test code parsing -->
        <dependency>
            <groupId>com.github.javaparser</groupId>
            <artifactId>javaparser-core</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <!-- needed for TigerCucumberRunner -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <!-- JSON Checker -->
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>${version.jsonassert}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${version.commons-collections4}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <artifactId>json-unit-spring</artifactId>
            <groupId>net.javacrumbs.json-unit</groupId>
            <version>${version.json-unit}</version>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
        </dependency>
        <!-- to easily compare xml structures -->
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-core</artifactId>
            <version>${version.xmlunit-core}</version>
        </dependency>
        <!-- test -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- TestNG driver is currently not supported with Serenity -->
        <!-- Junit 5 driver is currently not supported with Tiger -->
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-lambda</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <version>${version.spring-boot}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock-jre8</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-maven-plugin</artifactId>
                <version>1.18.20.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>delombok</goal>
                        </goals>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <addOutputDirectory>false</addOutputDirectory>
                            <sourceDirectory>src/main/java</sourceDirectory>
                            <outputDirectory>
                                ${project.build.directory}/delombok
                            </outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>jacoco-maven-plugin</artifactId>
                <groupId>org.jacoco</groupId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <doclint>none</doclint>
                    <sourcepath>${project.build.directory}/delombok</sourcepath>
                    <tags>
                        <tag>
                            <name>testenv</name>
                            <placement>a</placement>
                            <head>Testenvironment Variables:</head>
                        </tag>
                        <tag>
                            <name>gematik.context.out</name>
                            <placement>a</placement>
                            <head>Context OUT:</head>
                        </tag>
                        <tag>
                            <name>gematik.context.in</name>
                            <placement>a</placement>
                            <head>Context INPUT:</head>
                        </tag>
                    </tags>
                </configuration>
            </plugin>
            <!-- end create reusable test jar part -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${version.maven.failsafe}</version>
                <executions>
                    <execution>
                        <id>run-tests</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <argLine>${failsafe.jacoco.args}</argLine>
                    <includes>
                        <include>**/TestContextFeatureTest.java</include>
                    </includes>
                    <skipITs>false</skipITs>
                    <systemPropertyVariables>
                        <TIGER_TESTENV_CFGFILE>src/test/resources/testdata/noServersNoForwardProxy.yaml</TIGER_TESTENV_CFGFILE>
                    </systemPropertyVariables>
                    <threadCount>16</threadCount>
                    <forkCount>2</forkCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.serenity-bdd.maven.plugins</groupId>
                <artifactId>serenity-maven-plugin</artifactId>
                <version>${version.serenity.maven.plugin}</version>
                <dependencies>
                    <dependency>
                        <groupId>net.serenity-bdd</groupId>
                        <artifactId>serenity-core</artifactId>
                        <version>${version.serenity.core}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>serenity-reports</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>sonar-maven-plugin</artifactId>
                <groupId>org.sonarsource.scanner.maven</groupId>
            </plugin>
        </plugins>
    </build>
</project>
