<?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>
    <parent>
        <groupId>com.mulesoft.connectivity</groupId>
        <artifactId>connectivity-mule-adapter</artifactId>
        <version>1.2.0-SNAPSHOT</version>
    </parent>

    <artifactId>connectivity-mule-extension-tests</artifactId>
    <name>connectivity-mule-extension-tests</name>
    <description>Integration tests for connectivity-mule-extension using real connectors</description>

    <properties>
        <formatterConfigPath>../formatter.xml</formatterConfigPath>
        <gson.version>2.12.1</gson.version>
    </properties>

    <dependencies>
        <!-- Module under test -->
        <dependency>
            <groupId>com.mulesoft.connectivity</groupId>
            <artifactId>connectivity-mule-extension</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Real connector for integration testing -->
        <dependency>
            <groupId>com.mulesoft.connectivity.pulseconnector</groupId>
            <artifactId>pulseconnector-anypoint-connector-model</artifactId>
            <version>${project.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.connectivity</groupId>
            <artifactId>connectivity-mule-language</artifactId>
            <classifier>dw-library</classifier>
            <version>${ic.data.weave.service.api.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- LinkWeave test utilities -->
        <dependency>
            <groupId>com.mulesoft.connectivity</groupId>
            <artifactId>connectivity-model-api</artifactId>
            <version>${link.weave.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>http-netty-module</artifactId>
            <version>${data.weave.http.netty.module.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.weave</groupId>
            <artifactId>java-module</artifactId>
            <version>${data.weave.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-connector-ic</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.mulesoft.connectivity.pulseconnector</groupId>
                                    <artifactId>pulseconnector-anypoint-connector-model</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>mule-plugin</classifier>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                                    <includes>META-INF/pulseconnector.ic</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
