Uploaded image for project: 'Quarkus Documentation'
  1. Quarkus Documentation
  2. QDOCS-1190

Upgrade JUnit to 5.12.1 in Quarkus 3.20.1 to restore compatibility with quarkus-junit5-mockito

XMLWordPrintable

    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      == JUnit and Mockito version alignment in Red Hat build of Quarkus 3.20.1

      In the Red Hat build of Quarkus 3.20.0, the `quarkus-junit5-mockito` extension did not work due to a dependency mismatch: the included version of Mockito required JUnit 5.11 or later, but the platform was using JUnit 5.10.

      To resolve the issue, the Red Hat build of Quarkus 3.20.1 upgrades JUnit to version 5.12.1. This update restores compatibility between Mockito and JUnit and re-enables the `quarkus-junit5-mockito` extension.

      The overall impact is expected to be minimal. Community and Camel Quarkus testing showed no regressions. For details, see the related issue: https://github.com/quarkusio/quarkus/issues/46858.

      .Workaround

      If you experience compatibility issues after this update, you can override the JUnit version in your Maven project by adding a `dependencyManagement` entry in your `pom.xml` file. For example, to revert to JUnit 5.10.0:

      [source,xml]
      ----
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.10.0</version>
          </dependency>
        </dependencies>
      </dependencyManagement>
      ----

      This override ensures that JUnit 5.10.0 is used instead of the platform-managed version.
      Show
      == JUnit and Mockito version alignment in Red Hat build of Quarkus 3.20.1 In the Red Hat build of Quarkus 3.20.0, the `quarkus-junit5-mockito` extension did not work due to a dependency mismatch: the included version of Mockito required JUnit 5.11 or later, but the platform was using JUnit 5.10. To resolve the issue, the Red Hat build of Quarkus 3.20.1 upgrades JUnit to version 5.12.1. This update restores compatibility between Mockito and JUnit and re-enables the `quarkus-junit5-mockito` extension. The overall impact is expected to be minimal. Community and Camel Quarkus testing showed no regressions. For details, see the related issue: https://github.com/quarkusio/quarkus/issues/46858 . .Workaround If you experience compatibility issues after this update, you can override the JUnit version in your Maven project by adding a `dependencyManagement` entry in your `pom.xml` file. For example, to revert to JUnit 5.10.0: [source,xml] ---- <dependencyManagement>   <dependencies>     <dependency>       <groupId>org.junit.jupiter</groupId>       <artifactId>junit-jupiter</artifactId>       <version>5.10.0</version>     </dependency>   </dependencies> </dependencyManagement> ---- This override ensures that JUnit 5.10.0 is used instead of the platform-managed version.

      In Quarkus 3.20.1, the quarkus-junit5-mockito extension was non-functional due to an incompatibility between the versions of JUnit and Mockito. Mockito required JUnit 5.11 or later, but the platform was pinned to JUnit 5.10, which caused runtime failures in extension usage.

      To resolve the issue and align library versions, the platform now uses JUnit 5.12.1. This update restores functionality for the Mockito JUnit extension. While the update introduces minor changes in how JUnit handles class hierarchies and ExtensionContext, impact on user tests is expected to be minimal. Camel Quarkus test validation against the update showed no regressions.

      A workaround is available for customers who experience compatibility issues: explicitly downgrade JUnit in their project configuration.

      Tracking issue: https://github.com/quarkusio/quarkus/issues/46858

              rdlugyhe Rolfe Dlugy-Hegwer
              rdlugyhe Rolfe Dlugy-Hegwer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: