<?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>xyz.tcheeric</groupId>
        <artifactId>imani-wallet-lib</artifactId>
        <version>0.1.2</version>
    </parent>

    <artifactId>wallet-it</artifactId>
    <name>Wallet Integration Tests</name>
    <description>Integration tests for the Cashu Wallet</description>

    <dependencies>
        <!-- Wallet modules under test -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-cashu</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-app</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-nostr</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Test utilities from wallet-core-nostr -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-nostr</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <!-- NIP implementations for DM tests -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-nip-04</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-nip-44</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-nip-60</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Phoenixd for LN backend testing -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>phoenixd-rest</artifactId>
            <version>${phoenixd-rest.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Gateway Phoenixd for auto-paying mint quotes -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-gateway-phoenixd</artifactId>
            <version>${cashu-gateway-phoenixd.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- JUnit 5 -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Mockito -->
        <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>

        <!-- AssertJ -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- H2 Database for in-memory testing -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- HikariCP for connection pooling -->
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Testcontainers for Docker-based integration tests -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- OpenTelemetry for observability tests -->
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-api</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Spring Web for REST template -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Jackson for JSON processing -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- BouncyCastle for cryptographic operations -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Resilience4j for circuit breaker tests -->
        <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-circuitbreaker</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Surefire for self-contained integration tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <!-- Skip when wallet ITs are disabled (e.g., -Pit-gateway) -->
                    <skipTests>${skipITs.wallet}</skipTests>
                    <includes>
                        <!-- Hybrid tests: wallet logic with mocked MintApi (no external mint) -->
                        <include>**/*HybridIT.java</include>
                        <!-- Observability tests: Testcontainers Jaeger -->
                        <include>**/observability/*IT.java</include>
                        <!-- Nostr tests: Testcontainers relay -->
                        <include>**/nostr/*IT.java</include>
                    </includes>
                </configuration>
            </plugin>
            <!-- Failsafe for full integration tests requiring docker stack -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.plugin.version}</version>
                <configuration>
                    <skipITs>${skipITs.wallet}</skipITs>
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                    <systemPropertyVariables>
                        <WALLET_HOME>/tmp/.cashu-wallet-it</WALLET_HOME>
                    </systemPropertyVariables>
                    <groups>it-mint</groups>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
