Skip to content

Commit

Permalink
fix import statement, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
timo-abele committed Feb 16, 2024
1 parent e9d1690 commit 8813a12
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
Expression expected = args.get(0);
Expression actual = args.get(1);

maybeAddImport("org.assertj.core.api.Assertions", "assertThat");
//always add the import (even if not referenced)
maybeAddImport("org.assertj.core.api.Assertions", "assertThat", false);
maybeRemoveImport("org.junit.jupiter.api.Assertions");

if (args.size() == 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,23 +384,23 @@ public record OwnClass(String a) {
}
}
""",
"""
"""
package org.example;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
class ATest {
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class ATest {
@Test void testEquals() {
assertThat(new OwnClass()).isEqualTo(new OwnClass());
}
@Test void testEquals() {
assertThat(new OwnClass()).isEqualTo(new OwnClass());
}
public record OwnClass(String a) {
public record OwnClass(String a) {
public OwnClass() {this("1");}
}
public OwnClass() {this("1");}
}
}
"""
)
Expand Down

0 comments on commit 8813a12

Please sign in to comment.