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

Rewrite TestNG, JUnit Assertions to AssertJ #22305

Conversation

ssheikin
Copy link
Contributor

@ssheikin ssheikin commented Jun 6, 2024

Changed automatically by openrewrite recipe org.openrewrite.java.testing.assertj.JUnitToAssertj
and custom one org.openrewrite.java.testing.assertj.TestNgToAssertj
openrewrite/rewrite-testing-frameworks#520

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Jun 6, 2024
@ssheikin ssheikin requested a review from hashhar June 6, 2024 14:51
@github-actions github-actions bot added the delta-lake Delta Lake connector label Jun 6, 2024
@wendigo
Copy link
Contributor

wendigo commented Jun 6, 2024

Beautiful. Thank you @ssheikin

@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch from 2fc0711 to 1477c94 Compare June 6, 2024 20:56
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Jun 6, 2024
@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch 3 times, most recently from 3d65bad to b3703bd Compare June 6, 2024 21:23
@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch 2 times, most recently from 7d4c3c2 to 9c2c2c3 Compare June 6, 2024 21:34
@martint
Copy link
Member

martint commented Jun 6, 2024

Remove the "(automated)" / "(manual)" from the commit messages.

@ssheikin
Copy link
Contributor Author

ssheikin commented Jun 6, 2024

@martint should I squash those commits then?

@martint
Copy link
Member

martint commented Jun 6, 2024

Yes, not a bad idea, since they are multiple steps of the same logical change.

@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch 2 times, most recently from 203b11d to 2d8a434 Compare June 6, 2024 21:43
@ssheikin ssheikin changed the title Rewrite JUnit Assertions to AssertJ Rewrite TestNG, JUnit Assertions to AssertJ Jun 6, 2024
@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch from 2d8a434 to 05e4b1f Compare June 6, 2024 21:49
ssheikin added 3 commits June 6, 2024 23:49
Changed automatically by openrewrite recipe
```
<plugin>
    <groupId>org.openrewrite.maven</groupId>
    <artifactId>rewrite-maven-plugin</artifactId>
    <version>5.32.0</version>
    <configuration>
        <activeRecipes>
            <recipe>org.openrewrite.java.testing.assertj.JUnitToAssertj</recipe>
        </activeRecipes>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-testing-frameworks</artifactId>
            <version>2.10.1</version>
        </dependency>
    </dependencies>
</plugin>
```

run
```
./mvnw rewrite:run -Dmaven.javadoc.skip=true -DskipTests=true -Dmaven.site.skip=true -Dmaven.artifact.threads=16 -T 1C -e -Dair.check.skip-all=true --no-snapshot-updates -pl '!:trino-product-tests,!:trino-product-tests-launcher,!:trino-server-rpm'
```

Some formatting was fixed manually for readability.

Then, rewrite remaining JUnit Assertions to AssertJ manually, because
some entries were not migrated by `./mvnw rewrite:run`.
Changed automatically by openrewrite recipe
openrewrite/rewrite-testing-frameworks#520
```
<plugin>
    <groupId>org.openrewrite.maven</groupId>
    <artifactId>rewrite-maven-plugin</artifactId>
    <version>5.32.0</version>
    <configuration>
        <activeRecipes>
            <recipe>org.openrewrite.java.testing.assertj.TestNgToAssertj</recipe>
        </activeRecipes>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-testing-frameworks</artifactId>
            <version>2.11.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
</plugin>
```

run
```
./mvnw rewrite:run -Dmaven.javadoc.skip=true -DskipTests=true -Dmaven.site.skip=true -Dmaven.artifact.threads=16 -T 1C -e -Dair.check.skip-all=true --no-snapshot-updates -pl '!:trino-server-rpm'
```

Some formatting was fixed manually for readability.

Then, rewrite remaining TestNG Assertions to AssertJ manually, because
some entries were not migrated by `./mvnw rewrite:run`.
@ssheikin ssheikin force-pushed the ssheikin/940/trino/migrate-assertions-junit->assertj branch from 05e4b1f to 779f21b Compare June 6, 2024 21:50
@wendigo wendigo merged commit 52ec815 into trinodb:master Jun 7, 2024
97 checks passed
@github-actions github-actions bot added this to the 450 milestone Jun 7, 2024
@ssheikin ssheikin deleted the ssheikin/940/trino/migrate-assertions-junit->assertj branch June 7, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed delta-lake Delta Lake connector jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

3 participants