Skip to content

Commit

Permalink
[Archetype] Replace JUnit Jupiter with AssertJ (#2969)
Browse files Browse the repository at this point in the history
As a JUnit Platform Engine, Cucumber does not need JUnit Jupiter. It was
included as a dependency to allow users to use Assertions. This is
better done with AssertJ.
  • Loading branch information
mpkorstanje authored Feb 2, 2025
1 parent daeb1e4 commit fc5956b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [JUnit Platform Engine] Set Engine-Version-cucumber attribute ([#2963](https://github.com/cucumber/cucumber-jvm/pull/2963) M.P. Korstanje)

### Changed
- [Archetype] Replace JUnit Jupiter with AssertJ ([#2969](https://github.com/cucumber/cucumber-jvm/pull/2969) M.P. Korstanje)
- [JUnit Platform Engine] Use JUnit Platform 1.11.3 (JUnit Jupiter 5.11.3)

### Added
Expand Down
2 changes: 1 addition & 1 deletion cucumber-archetype/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ This is a Maven Archetype for setting up an empty Cucumber project. Used by the
mvn archetype:generate \
-DarchetypeGroupId=io.cucumber \
-DarchetypeArtifactId=cucumber-archetype \
-DarchetypeVersion=${cucumber.version} \
-DarchetypeVersion=${cucumber.version}
```
11 changes: 11 additions & 0 deletions cucumber-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<properties>
<junit-jupiter.version>5.11.4</junit-jupiter.version>
<assertj.version>3.25.3</assertj.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
</properties>
Expand All @@ -39,6 +40,16 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Not used by this module. But ensures the assertj.version
in the archetype template is also automatically updated by renovate
bot. -->
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-bom</artifactId>
<version>${assertj.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-bom</artifactId>
<version>${assertj.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -52,8 +59,8 @@
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.cucumber.java.en.*;

import static org.junit.jupiter.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;

public class StepDefinitions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-bom</artifactId>
<version>${assertj.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -52,8 +59,8 @@
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.cucumber.java.en.*;

import static org.junit.jupiter.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;

public class StepDefinitions {

Expand Down

0 comments on commit fc5956b

Please sign in to comment.