Skip to content

Commit fe6c497

Browse files
1 parent fa95357 commit fe6c497

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,33 @@ examples:
10391039
language: java
10401040
---
10411041
type: specs.openrewrite.org/v1beta/example
1042+
recipeName: org.openrewrite.java.testing.assertj.SimplifyStreamMapToExtracting
1043+
examples:
1044+
- description: '`SimplifyStreamMapToExtractingTest#streamMapWithMethodReference`'
1045+
sources:
1046+
- before: |
1047+
import java.util.List;
1048+
1049+
import static org.assertj.core.api.Assertions.assertThat;
1050+
1051+
class MyTest {
1052+
void testMethod(List<Row> rows) {
1053+
assertThat(rows.stream().map(Row::getValue)).contains("a");
1054+
}
1055+
}
1056+
after: |
1057+
import java.util.List;
1058+
1059+
import static org.assertj.core.api.Assertions.assertThat;
1060+
1061+
class MyTest {
1062+
void testMethod(List<Row> rows) {
1063+
assertThat(rows).extracting(Row::getValue).contains("a");
1064+
}
1065+
}
1066+
language: java
1067+
---
1068+
type: specs.openrewrite.org/v1beta/example
10421069
recipeName: org.openrewrite.java.testing.assertj.StaticImports
10431070
examples:
10441071
- description: '`StaticImportsTest#useStaticImports`'

0 commit comments

Comments
 (0)