assertj-automation icon indicating copy to clipboard operation
assertj-automation copied to clipboard

Automatic code rewriting for AssertJ using error-prone and refaster

Results 14 assertj-automation issues
Sort by recently updated
recently updated
newest added

###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. To enable or disable this check, please contact the maintainers of Excavator.

no changelog
merge when ready

## What happened? AssertionsForClassTypes exists as a near-duplicate of the assertj Assertions class. My understanding is that this is due to a deficiency in the Java type system in earlier...

## What happened? assertj-automation would try to convert `org.junit.jupiter.api.Assertions.assertThrows` to an `assertThatThrownBy` assertion when the return value of `assertThrows` is used: ```java MyException e = assertThatThrownBy(() -> throwingMethod()).isInstanceOf(MyException.class); ``` However...

## What happened? I'm adding `assertj-error-prone` to a Maven project, and Maven fails :( See the very end of https://repo1.maven.org/maven2/com/palantir/assertj-automation/assertj-error-prone/0.6.0/assertj-error-prone-0.6.0.pom ```xml com.palantir.assertj-automation assertj-automation-root 0.4.0 compile true ``` --- My configuration:...

## What happened? We have plenty of tests using TestNg assertions. It would be great to have a way to migrate all TestNg assertion usages to AssertJ. ## What did...

## What happened? Code of the form ``` byte b = (byte) 0; assertEquals(b, 0); ``` passes under JUnit assertions. However, this is re-written as ``` byte b = (byte)...

## What happened? If the returned Throwable of Junit's `assertThrows` is used for further checks, the build breaks when the "Prefer AssertJ" conversion is applied. This is because AssertJ's `assertThatThrownBy`...

## What happened? People write: ``` try { Main.processArgs("-offset", "10", "-length", "20", "-length", "50", "Foo.java"); fail("fail"); } catch (UsageException e) { // expected } ``` e.g. https://github.com/palantir/palantir-java-format/blob/78e4387d65b232a2fbff3cf9c39fffc7167460ec/palantir-java-format/src/test/java/com/palantir/javaformat/java/CommandLineFlagsTest.java ## What did...

I think using `.isTrue()` on any kind of complex assertion is probably a codesmell, so might be worth replacing stuff like this: ```diff -assertThat(result.getTestResults().stream().allMatch( - testResult -> testResult.getType().equals(RegressionTestResultType.NO_REGRESSION))).isTrue(); +assertThat(result.getTestResults()).allMatch( +...

###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/gradle-jdks-buildscript-upgrades check. To enable or disable this check, please contact the maintainers of Excavator.

no changelog
merge when ready