You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/asciidoc/user-guide/assertj-core-migration.adoc
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ The preferred approach is to use the provided migration scripts or OpenRewrite r
34
34
35
35
It is as simple as running one of the following scripts depending on which test framework you are using:
36
36
37
-
* {current-branch}/assertj-core/src/main/scripts/convert-junit-assertions-to-assertj.sh[JUnit 3/4 to AssertJ migration script]
38
-
* {current-branch}/assertj-core/src/main/scripts/convert-junit5-assertions-to-assertj.sh[JUnit 5 to AssertJ migration script]
39
-
* {current-branch}/assertj-core/src/main/scripts/convert-testng-assertions-to-assertj.sh[TestNG to AssertJ migration script]
37
+
* {current-branch}/scripts/convert-junit-assertions-to-assertj.sh[JUnit 3/4 to AssertJ migration script]
38
+
* {current-branch}/scripts/convert-junit5-assertions-to-assertj.sh[JUnit 5 to AssertJ migration script]
39
+
* {current-branch}/scripts/convert-testng-assertions-to-assertj.sh[TestNG to AssertJ migration script]
40
40
41
41
Each shell script is based on the sed stream editor and regexps. It *recursively* looks at all `*Test.java` files and
42
42
performs search and replace to convert assertions to AssertJ ones.
@@ -128,9 +128,10 @@ To learn more about how to run these recipes, please see the link:https://docs.o
128
128
129
129
Here's a list of find/replace expressions to change JUnit assertions into AssertJ assertions (don't forget to check the regex mode in your editor replace window).
130
130
131
-
This regexes described in this section are specific to JUnit 4 but you can easily adapt them for JUnit 5 or TestNG.
131
+
These regexes described in this section are specific to JUnit 4, but you can easily adapt them for JUnit 5 or TestNG.
132
132
133
-
The order of find/replace is important to benefit from the most relevant AssertJ assertions. For example you should convert `assertEquals(0, myList.size())` to `assertThat(myList).isEmpty()` instead of `assertThat(myList.size()).isEqualTo(0)`.
133
+
The order of find/replace is important to benefit from the most relevant AssertJ assertions.
134
+
For example, you should convert `assertEquals(0, myList.size())` to `assertThat(myList).isEmpty()` instead of `assertThat(myList.size()).isEqualTo(0)`.
134
135
135
136
136
137
===== Converting `assertEquals(0, myList.size())` to `assertThat(myList).isEmpty()`
0 commit comments