Skip to content

Commit 5326f83

Browse files
committed
Fix several deprecations in AssertJ custom assertions
1 parent b16b403 commit 5326f83

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

etc/assertj-templates/assertion_class_template.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_ass
2020
* @param actual the ${class_to_assert} we want to make assertions on.
2121
* @return a new <code>{@link ${custom_assertion_class}}</code>
2222
*/
23-
@org.assertj.core.util.CheckReturnValue
23+
@org.assertj.core.annotation.CheckReturnValue
2424
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
2525
return new ${custom_assertion_class}(actual);
2626
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Creates a new instance of <code>{@link ${custom_assertion_class}}</code>.
3+
*
4+
* @param actual the actual value.
5+
* @return the created assertion object.
6+
*/
7+
@org.assertj.core.annotation.CheckReturnValue
8+
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
9+
return new ${custom_assertion_class}(actual);
10+
}

etc/assertj-templates/soft_assertions_entry_point_class_template.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package ${package};
33
/**
44
* Entry point for soft assertions of different data types.
55
*/
6-
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
76
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
87
public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions {
98
${all_assertions_entry_points}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Creates a new "soft" instance of <code>{@link ${custom_assertion_class}}</code>.
3+
*
4+
* @param actual the actual value.
5+
* @return the created "soft" assertion object.
6+
*/
7+
@org.assertj.core.annotation.CheckReturnValue
8+
public ${custom_assertion_class} assertThat(${class_to_assert} actual) {
9+
return proxy(${custom_assertion_class}.class, ${class_to_assert}.class, actual);
10+
}

0 commit comments

Comments
 (0)