Skip to content

Commit

Permalink
Create minimal example that fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Nov 12, 2024
1 parent 171d6b9 commit 154fb1a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@
<exclusions>
<exclusion>**/docker/**</exclusion>
<exclusion>**/AbstractComparableTest.java</exclusion>
<exclusion>**/AbstractEqualsTest.java</exclusion>
<exclusion>**/EnsureTest.java</exclusion>
<exclusion>**/ResourceExtractorTest.java</exclusion>
</exclusions>
<activeRecipes>
<recipe>org.openrewrite.maven.BestPractices</recipe>
Expand Down
24 changes: 24 additions & 0 deletions src/test/java/edu/hm/hafner/util/ACTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package edu.hm.hafner.util;

public abstract class ACTest<T extends Comparable<T>> {
void shouldBeNegativeIfThisIsSmaller() {
T smaller = createSmallerSut();

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'T smaller' is never read.
T greater = createGreaterSut();

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'T greater' is never read.
}

/**
* Creates a subject under test. The SUT must be smaller than the SUT of the opposite method {@link
* #createGreaterSut()}.
*
* @return the SUT
*/
protected abstract T createSmallerSut();

/**
* Creates a subject under test. The SUT must be greater than the SUT of the opposite method {@link
* #createSmallerSut()}.
*
* @return the SUT
*/
protected abstract T createGreaterSut();
}

0 comments on commit 154fb1a

Please sign in to comment.