Skip to content

Commit

Permalink
Fix test indentation and type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Aug 9, 2023
1 parent bb70a82 commit b5f9f0c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies {

testImplementation("org.openrewrite:rewrite-java-17")
testImplementation("org.openrewrite:rewrite-groovy")
testImplementation("org.assertj:assertj-core:3.24.2")

testRuntimeOnly("org.gradle:gradle-tooling-api:latest.release")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CollapseConsecutiveAssertThatStatementsTest implements RewriteTest {
public void defaults(RecipeSpec spec) {
spec
.parser(JavaParser.fromJavaVersion()
.classpathFromResources(new InMemoryExecutionContext(), "assertj-core-3.24"))
.classpathFromResources(new InMemoryExecutionContext(), "assertj-core-3.24", "junit-jupiter-api-5.9"))
.recipe(new CollapseConsecutiveAssertThatStatements());
}

Expand All @@ -53,6 +53,7 @@ public void test() {
assertThat(listA).hasSize(3);
assertThat(listA).containsExactly("a", "b", "c");
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand All @@ -70,10 +71,11 @@ public class MyTest {
public void test() {
List<String> listA = Arrays.asList("a", "b", "c");
assertThat(listA)
.isNotNull()
.hasSize(3)
.containsExactly("a", "b", "c");
.isNotNull()
.hasSize(3)
.containsExactly("a", "b", "c");
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand Down Expand Up @@ -106,6 +108,7 @@ public void test() {
assertThat(listB).isNotNull();
assertThat(listB).hasSize(3);
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand All @@ -123,14 +126,15 @@ public class MyTest {
public void test() {
List<String> listA = Arrays.asList("a", "b", "c");
assertThat(listA)
.isNotNull()
.hasSize(3)
.containsExactly("a", "b", "c");
.isNotNull()
.hasSize(3)
.containsExactly("a", "b", "c");
List<String> listB = Arrays.asList("a", "b", "c");
assertThat(listB)
.isNotNull()
.hasSize(3);
.isNotNull()
.hasSize(3);
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand Down Expand Up @@ -163,6 +167,7 @@ public void test() {
assertThat(listB).isNotNull();
assertThat(listB).hasSize(3);
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand All @@ -180,14 +185,15 @@ public class MyTest2 {
public void test() {
List<String> listA = Arrays.asList("a", "b", "c");
assertThat(listA)
.isNotNull()
.hasSize(3);
.isNotNull()
.hasSize(3);
List<String> listB = Arrays.asList("a", "b", "c");
assertThat(listA).containsExactly("a", "b", "c");
assertThat(listB)
.isNotNull()
.hasSize(3);
.isNotNull()
.hasSize(3);
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand Down Expand Up @@ -218,6 +224,7 @@ public void test() {
assertThat(x).hasSize(3);
assertThat(listA).containsExactly("a", "b", "c");
}
private int[] notification() {
return new int[]{1, 2, 3};
}
Expand Down

0 comments on commit b5f9f0c

Please sign in to comment.