|
33 | 33 |
|
34 | 34 | /** |
35 | 35 | * Converts Pragmatists JUnitParamsRunner tests to their JUnit 5 ParameterizedTest and associated MethodSource equivalent |
36 | | - * https://github.com/Pragmatists/JUnitParams |
37 | | - * |
| 36 | + * <a href="https://github.com/Pragmatists/JUnitParams">...</a> |
38 | 37 | * Supports the following conversions |
39 | 38 | * `@Parameters` annotation with out arguments and default `parametersFor...` init-method exists |
40 | 39 | * `@Parameters(method = "...")` annotation with defined method references |
@@ -123,7 +122,7 @@ public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ex |
123 | 122 | } else if (anno.getArguments() != null && !anno.getArguments().isEmpty()) { |
124 | 123 | // This conversion is not supported add a comment to the annotation and the method name to the not supported list |
125 | 124 | String comment = " JunitParamsRunnerToParameterized conversion not supported"; |
126 | | - if (anno.getComments().stream().noneMatch(c -> c.printComment().endsWith(comment))) { |
| 125 | + if (anno.getComments().stream().noneMatch(c -> c.printComment(getCursor()).endsWith(comment))) { |
127 | 126 | anno = anno.withComments(ListUtils.concat(anno.getComments(), new TextComment(false, comment, |
128 | 127 | "\n" + anno.getPrefix().getIndent(), Markers.EMPTY))); |
129 | 128 | } |
@@ -309,7 +308,7 @@ private String getAnnotationArgumentValueForMethodTemplate(J.Annotation anno) { |
309 | 308 | if (annotationArgumentValue != null) { |
310 | 309 | String[] methodRefs = annotationArgumentValue.split(","); |
311 | 310 | if (methodRefs.length > 1) { |
312 | | - String methods = Arrays.stream(methodRefs).map(mref -> mref = "\"" + mref + "\"").collect(Collectors.joining(", ")); |
| 311 | + String methods = Arrays.stream(methodRefs).map(mref -> "\"" + mref + "\"").collect(Collectors.joining(", ")); |
313 | 312 | annotationArgumentValue = "{" + methods + "}"; |
314 | 313 | } else { |
315 | 314 | annotationArgumentValue = "\"" + annotationArgumentValue + "\""; |
|
0 commit comments