Skip to content

Commit

Permalink
Remove dependency to javax.annotation-api.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Oct 16, 2023
1 parent 0c646e6 commit eafb21d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions etc/assertj-templates/assertion_class_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package ${package};
${imports}
/**
* {@link ${class_to_assert}} specific assertions - Generated by CustomAssertionGenerator.
*/
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_assertion_class}, ${class_to_assert}> {

/**
* Creates a new <code>{@link ${custom_assertion_class}}</code> to make assertions on actual ${class_to_assert}.
* @param actual the ${class_to_assert} we want to make assertions on.
*/
public ${custom_assertion_class}(${class_to_assert} actual) {
super(actual, ${custom_assertion_class}.class);
}

/**
* An entry point for ${custom_assertion_class} to follow AssertJ standard <code>assertThat()</code> statements.<br>
* With a static import, one can write directly: <code>assertThat(my${class_to_assert})</code> and get specific assertion with code completion.
* @param actual the ${class_to_assert} we want to make assertions on.
* @return a new <code>{@link ${custom_assertion_class}}</code>
*/
@org.assertj.core.util.CheckReturnValue
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
return new ${custom_assertion_class}(actual);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package ${package};
* type-specific assertion objects.
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
@javax.annotation.Generated(value="assertj-assertions-generator")
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class Assertions extends org.assertj.core.api.Assertions {
${all_assertions_entry_points}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package ${package};
* Entry point for soft assertions of different data types.
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
@javax.annotation.Generated(value="assertj-assertions-generator")
@edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions {
${all_assertions_entry_points}
}

0 comments on commit eafb21d

Please sign in to comment.