|
15 | 15 | */ |
16 | 16 | package org.openrewrite.java.testing.assertj; |
17 | 17 |
|
| 18 | +import lombok.Getter; |
18 | 19 | import org.openrewrite.ExecutionContext; |
19 | 20 | import org.openrewrite.Preconditions; |
20 | 21 | import org.openrewrite.Recipe; |
@@ -61,18 +62,14 @@ public class MigrateAssertionsForClassTypes extends Recipe { |
61 | 62 | "org.assertj.core.api.AssertDelegateTarget" |
62 | 63 | ); |
63 | 64 |
|
64 | | - @Override |
65 | | - public String getDisplayName() { |
66 | | - return "Use `Assertions.assertThatObject` for ambiguous `AssertionsForClassTypes.assertThat` calls"; |
67 | | - } |
| 65 | + @Getter |
| 66 | + final String displayName = "Use `Assertions.assertThatObject` for ambiguous `AssertionsForClassTypes.assertThat` calls"; |
68 | 67 |
|
69 | | - @Override |
70 | | - public String getDescription() { |
71 | | - return "The deprecated `AssertionsForClassTypes.assertThat(T)` always returns an `ObjectAssert`, while the " + |
72 | | - "unified `Assertions.assertThat` additionally offers more specific overloads (e.g. for `Iterable`, " + |
73 | | - "`Map`, `Predicate`). For arguments matching those overloads, rename `assertThat` to `assertThatObject` " + |
74 | | - "so that migrating to `Assertions` keeps returning an `ObjectAssert` and the code keeps compiling."; |
75 | | - } |
| 68 | + @Getter |
| 69 | + final String description = "The deprecated `AssertionsForClassTypes.assertThat(T)` always returns an `ObjectAssert`, while the " + |
| 70 | + "unified `Assertions.assertThat` additionally offers more specific overloads (e.g. for `Iterable`, " + |
| 71 | + "`Map`, `Predicate`). For arguments matching those overloads, rename `assertThat` to `assertThatObject` " + |
| 72 | + "so that migrating to `Assertions` keeps returning an `ObjectAssert` and the code keeps compiling."; |
76 | 73 |
|
77 | 74 | @Override |
78 | 75 | public TreeVisitor<?, ExecutionContext> getVisitor() { |
|
0 commit comments