Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose rewrite issue 4488 #1227

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/rewrite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'OpenRewrite'

on:
push:
branches:
- main
pull_request:

jobs:
coverage:

runs-on: ubuntu-latest
name: Run open rewrite

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.9
- name: Run open-rewrite
run: mvn -V --color always -ntp clean rewrite:run
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();
}
Loading