Skip to content

Commit a216154

Browse files
committed
Unconditionally add the import for assertThrows, got a report where the template adds the method successfully but with missing type attribution for assertThrows so the import was missing
1 parent f4a0a01 commit a216154

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/openrewrite/java/testing/junit5/GradleUseJunitJupiter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ private static class AddUseJUnitPlatform extends GroovyIsoVisitor<ExecutionConte
149149
public G.CompilationUnit visitCompilationUnit(G.CompilationUnit cu, ExecutionContext ctx) {
150150
G.CompilationUnit template = GradleParser.builder()
151151
.build()
152-
.parse("plugins {\n" +
152+
.parse(ctx,
153+
"plugins {\n" +
153154
" id 'java'\n" +
154155
"}\n" +
155156
"tasks.withType(Test).configureEach {\n" +
@@ -235,7 +236,8 @@ public J.Lambda visitLambda(J.Lambda l, ExecutionContext ctx) {
235236
}
236237
G.CompilationUnit cu = GradleParser.builder()
237238
.build()
238-
.parse("plugins {\n" +
239+
.parse(ctx,
240+
"plugins {\n" +
239241
" id 'java'\n" +
240242
"}\n" +
241243
"tasks.withType(Test) {\n" +

0 commit comments

Comments
 (0)