Skip to content

Commit fe9a87d

Browse files
committed
Updated with the latest changes from rewrite.
1 parent 5f48484 commit fe9a87d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/main/java/org/openrewrite/java/testing/cleanup/TestsShouldIncludeAssertions.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.openrewrite.java.JavaTemplate;
2424
import org.openrewrite.java.search.UsesType;
2525
import org.openrewrite.java.tree.J;
26-
import org.openrewrite.java.tree.Statement;
2726
import org.openrewrite.java.tree.TypeUtils;
2827

2928
import java.util.Arrays;
@@ -124,7 +123,7 @@ private boolean methodIsTest(J.MethodDeclaration methodDeclaration) {
124123

125124
private boolean methodHasAssertion(J.Block body) {
126125
AtomicBoolean hasAssertion = new AtomicBoolean(Boolean.FALSE);
127-
JavaIsoVisitor findAssertionVisitor = new JavaIsoVisitor<AtomicBoolean>() {
126+
JavaIsoVisitor<AtomicBoolean> findAssertionVisitor = new JavaIsoVisitor<AtomicBoolean>() {
128127
@Override
129128
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, AtomicBoolean atomicBoolean) {
130129
J.MethodInvocation mi = super.visitMethodInvocation(method, atomicBoolean);
@@ -158,5 +157,5 @@ private boolean isAssertion(J.MethodInvocation methodInvocation) {
158157
}
159158
return false;
160159
}
161-
};
160+
}
162161
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private Stream<J.Annotation> categoryAnnotationToTagAnnotations(J.Annotation may
111111
randomId(),
112112
Space.EMPTY,
113113
Markers.EMPTY,
114-
J.Identifier.build(randomId(), Space.EMPTY, Markers.EMPTY, tagType.getClassName(), tagType),
114+
new J.Identifier(randomId(), Space.EMPTY, Markers.EMPTY, tagType.getClassName(), tagType, null),
115115
JContainer.build(Space.EMPTY,
116116
Collections.singletonList(
117117
new JRightPadded<>(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
341341

342342
// Change constructor to test init method
343343
if (initMethodDeclarationTemplate == null && m.isConstructor()) {
344-
m = m.withName(m.getName().withName(initMethodName));
344+
m = m.withName(m.getName().withSimpleName(initMethodName));
345345
m = maybeAutoFormat(m, m.withReturnTypeExpression(new J.Primitive(randomId(), Space.EMPTY, Markers.EMPTY, JavaType.Primitive.Void)),
346346
executionContext, getCursor().dropParentUntil(J.class::isInstance));
347347

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,12 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
120120

121121
if (method.getThrows() == null || method.getThrows().stream()
122122
.noneMatch(n -> TypeUtils.isOfClassType(n.getType(), IO_EXCEPTION_FQN))) {
123-
J.Identifier ioExceptionIdent = J.Identifier.build(UUID.randomUUID(),
123+
J.Identifier ioExceptionIdent = new J.Identifier(UUID.randomUUID(),
124124
Space.format(" "),
125125
Markers.EMPTY,
126126
"IOException",
127-
JavaType.Class.build(IO_EXCEPTION_FQN));
127+
JavaType.Class.build(IO_EXCEPTION_FQN),
128+
null);
128129
method = method.withThrows(ListUtils.concat(method.getThrows(), ioExceptionIdent));
129130
maybeAddImport(IO_EXCEPTION_FQN);
130131
}

0 commit comments

Comments
 (0)