Déjà présent dans pom.xml
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit5</artifactId>
            <scope>test</scope>
        </dependency>
Exécution des tests en local :
mvn -B -U -ntp test
A mettre dans .github/workflows/ci-tests.yml :
Vérifiez :
name: CI • Tests (Maven)
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
concurrency:
  group: ci-tests-${{ github.ref }}
  cancel-in-progress: true
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ '17' ] 
    env:
      MAVEN_OPTS: -XX:+UseParallelGC -Xmx1g -Djava.awt.headless=true
      MAVEN_ARGS: ""
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Temurin JDK
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: ${{ matrix.java }}
          cache: maven
      - name: Build & test
        run: mvn -B -U -ntp $MAVEN_ARGS verify
      - name: Upload test and coverage reports
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: test-reports-java-${{ matrix.java }}
          path: |
            **/target/surefire-reports/**
            **/target/failsafe-reports/**
            **/target/site/jacoco/**
          retention-days: 7
Le workflow :
Ajoute la configuration JaCoCo+Surefire dans pom.xml :
Ajouter les numéros de version :
    <properties>
        <java.version>17</java.version>
        <kotlin.version>1.9.25</kotlin.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
        <jacoco.version>0.8.12</jacoco.version>
    </properties>
    
Ajouter les 2 plugins Maven suivants :
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>${maven.surefire.plugin.version}</version>
      <configuration>
        <useModulePath>false</useModulePath>
      </configuration>
    </plugin>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <version>${jacoco.version}</version>
      <executions>
        <execution>
          <goals>
            <goal>prepare-agent</goal>
          </goals>
        </execution>
        <execution>
          <id>report</id>
          <phase>test</phase>
          <goals>
            <goal>report</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
Le rapport de couverture (téléchargeable via actions) :
Ajout d'une exécution jacoco:check pour échouer sous le seuil de 80% de couverture :
<execution>
  <id>check</id>
  <goals><goal>check</goal></goals>
  <configuration>
    <rules>
      <rule>
        <element>BUNDLE</element>
        <limits>
          <limit>
            <counter>INSTRUCTION</counter>
            <value>COVEREDRATIO</value>
            <minimum>0.80</minimum>
          </limit>
        </limits>
      </rule>
    </rules>
  </configuration>
</execution>
on:
  pull_request:
    branches: [ master ]
    paths: [ 'src/**', 'pom.xml', '.github/workflows/**' ]