File tree 5 files changed +31
-9
lines changed
src/main/java/edu/hm/hafner/util
5 files changed +31
-9
lines changed Original file line number Diff line number Diff line change
1
+ package ${package};
2
+ ${imports}
3
+ /**
4
+ * {@link ${class_to_assert}} specific assertions - Generated by CustomAssertionGenerator.
5
+ */
6
+ @edu.hm.hafner.util.Generated(value="assertj-assertions-generator")
7
+ public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_assertion_class}, ${class_to_assert}> {
8
+
9
+ /**
10
+ * Creates a new <code>{@link ${custom_assertion_class}}</code> to make assertions on actual ${class_to_assert}.
11
+ * @param actual the ${class_to_assert} we want to make assertions on.
12
+ */
13
+ public ${custom_assertion_class}(${class_to_assert} actual) {
14
+ super(actual, ${custom_assertion_class}.class);
15
+ }
16
+
17
+ /**
18
+ * An entry point for ${custom_assertion_class} to follow AssertJ standard <code>assertThat()</code> statements.<br>
19
+ * With a static import, one can write directly: <code>assertThat(my${class_to_assert})</code> and get specific assertion with code completion.
20
+ * @param actual the ${class_to_assert} we want to make assertions on.
21
+ * @return a new <code>{@link ${custom_assertion_class}}</code>
22
+ */
23
+ @org.assertj.core.util.CheckReturnValue
24
+ public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
25
+ return new ${custom_assertion_class}(actual);
26
+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ package ${package};
5
5
* type-specific assertion objects.
6
6
*/
7
7
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
8
- @javax.annotation .Generated(value="assertj-assertions-generator")
8
+ @edu.hm.hafner.util .Generated(value="assertj-assertions-generator")
9
9
public class Assertions extends org.assertj.core.api.Assertions {
10
10
${all_assertions_entry_points}
11
11
/**
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ package ${package};
4
4
* Entry point for soft assertions of different data types.
5
5
*/
6
6
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM")
7
- @javax.annotation .Generated(value="assertj-assertions-generator")
7
+ @edu.hm.hafner.util .Generated(value="assertj-assertions-generator")
8
8
public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions {
9
9
${all_assertions_entry_points}
10
10
}
Original file line number Diff line number Diff line change 136
136
</dependencyManagement >
137
137
138
138
<dependencies >
139
- <dependency >
140
- <groupId >javax.annotation</groupId >
141
- <artifactId >javax.annotation-api</artifactId >
142
- <version >${javax.annotation-api.version} </version >
143
- </dependency >
144
139
<dependency >
145
140
<groupId >com.github.spotbugs</groupId >
146
141
<artifactId >spotbugs-annotations</artifactId >
487
482
<assertionsEntryPointClass >assertions_entry_point_class_template.txt</assertionsEntryPointClass >
488
483
<softEntryPointAssertionClass >soft_assertions_entry_point_class_template.txt</softEntryPointAssertionClass >
489
484
<objectAssertion >has_assertion_template.txt</objectAssertion >
485
+ <assertionClass >assertion_class_template.txt</assertionClass >
490
486
</templates >
491
487
<packages >
492
488
<package >edu.hm.hafner.util</package >
Original file line number Diff line number Diff line change 8
8
9
9
/**
10
10
* This annotation is used to mark source code that has been generated or is somehow not relevant for style checking or
11
- * code coverage analysis. This annotation is quite similar to the annotation @{@link javax.annotation.Generated}. The
12
- * main difference is that it has class retention on so is available for tools that work on the bytecode (like JaCoCo,
11
+ * code coverage analysis. It is quite similar to the {@code javax.annotation.Generated} annotation . The
12
+ * main difference is that it has class retention on so is available for tools that work on bytecode (like JaCoCo,
13
13
* PIT, or SpotBugs).
14
14
*/
15
15
@ Retention (CLASS )
You can’t perform that action at this time.
0 commit comments