Skip to content

Conversation

svc-excavator-bot
Copy link
Collaborator

excavator is a bot for automating changes across repositories.

Changes produced by the roomba/junit5 check.

To enable or disable this check, please contact the maintainers of Excavator.

@svc-excavator-bot svc-excavator-bot force-pushed the roomba/junit5 branch 2 times, most recently from c20776f to 9e73c22 Compare March 17, 2025 23:57
Copy link

stale bot commented Jun 27, 2025

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@aldexis aldexis requested a review from pkoenig10 July 24, 2025 10:09
@aldexis
Copy link

aldexis commented Jul 24, 2025

As discussed internally, [CompilationRule](https://github.com/google/compile-testing/blob/main/src/main/java/com/google/testing/compile/CompilationRule.java) does not have a JUnit5 replacement (per google/compile-testing#146).

There were three options:

Compiler.javac()
    .withProcessors(new AbstractProcessor() {
        @Override
        public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
            test.accept(processingEnv.getElementUtils());
            return false;
        }
    })
    .compile(DUMMY)
  • Downside: we need to update and add unsavory indentation to all these tests
  • Leave these tests to use junit4 for now

We decided to go with that third option for now and disable the excavator once this PR merges

Comment on lines 44 to 46
Assertions.assertThrows(NullPointerException.class, () -> {
TypeName.BOOLEAN.annotated((AnnotationSpec[]) null);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use AssertJ

Suggested change
Assertions.assertThrows(NullPointerException.class, () -> {
TypeName.BOOLEAN.annotated((AnnotationSpec[]) null);
});
assertThatThrownBy(() -> {
TypeName.BOOLEAN.annotated((AnnotationSpec[]) null);
})
.isInstanceOf(NullPointerException.class);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - this was updated by the excacvator and I didn't notice. I'll push a change

@bulldozer-bot bulldozer-bot bot merged commit 8a25717 into develop Jul 24, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the roomba/junit5 branch July 24, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants