Skip to content

Commit

Permalink
Fix package name typo which was leading to imports not being added by…
Browse files Browse the repository at this point in the history
… OutputCaptureExtension. Should fix #46 for real this time.
  • Loading branch information
sambsnyd committed Apr 24, 2021
1 parent 1de360c commit 7db05b4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public class OutputCaptureExtension extends Recipe {
Parser.Input.fromString("package org.springframework.boot.test.system;\n" +
"public interface CapturedOutput {\n" +
" String getAll();\n" +
"}"),
Parser.Input.fromString("package org.junit.jupiter.api.extension.ExtendWith;\n" +
"}"
),
Parser.Input.fromString("package org.junit.jupiter.api.extension;\n" +
"public @interface ExtendWith {\n" +
" Class[] value();\n" +
"}")
Expand Down Expand Up @@ -115,10 +116,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
))
);

// We got a bug report that this import wasn't being added
// Couldn't reproduce why, assumed that type attribution failed for reasons that aren't obvious.
// Setting onlyIfReferenced to "false" just to be sure.
doAfterVisit(new AddImport<>("org.springframework.boot.test.system.OutputCaptureExtension", null, false));
maybeAddImport("org.springframework.boot.test.system.OutputCaptureExtension");
maybeAddImport("org.junit.jupiter.api.extension.ExtendWith");
}

Expand Down

0 comments on commit 7db05b4

Please sign in to comment.