Skip to content

Commit 91418e6

Browse files
1 parent 345ac0a commit 91418e6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/main/resources/META-INF/rewrite/examples.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,35 @@ examples:
10101010
language: java
10111011
---
10121012
type: specs.openrewrite.org/v1beta/example
1013+
recipeName: org.openrewrite.java.testing.assertj.SimplifySequencedCollectionAssertions
1014+
examples:
1015+
- description: '`SimplifySequencedCollectionAssertionsTest#getLast`'
1016+
sources:
1017+
- before: |
1018+
import java.util.List;
1019+
1020+
import static org.assertj.core.api.Assertions.assertThat;
1021+
1022+
class MyTest {
1023+
void testMethod() {
1024+
List<String> list = List.of("a", "b", "c");
1025+
assertThat(list.getLast()).isEqualTo("c");
1026+
}
1027+
}
1028+
after: |
1029+
import java.util.List;
1030+
1031+
import static org.assertj.core.api.Assertions.assertThat;
1032+
1033+
class MyTest {
1034+
void testMethod() {
1035+
List<String> list = List.of("a", "b", "c");
1036+
assertThat(list).last().isEqualTo("c");
1037+
}
1038+
}
1039+
language: java
1040+
---
1041+
type: specs.openrewrite.org/v1beta/example
10131042
recipeName: org.openrewrite.java.testing.assertj.StaticImports
10141043
examples:
10151044
- description: '`StaticImportsTest#useStaticImports`'

0 commit comments

Comments
 (0)