BAEL-602 use Stream.of
This commit is contained in:
parent
08ced40547
commit
0fcae56196
|
@ -36,8 +36,8 @@ public class JOOLTest {
|
|||
@Test
|
||||
public void givenStreams_whenJoin_shouldHaveElementsFromTwoStreams() {
|
||||
//given
|
||||
Stream<Integer> left = Arrays.asList(1, 2, 4).stream();
|
||||
Stream<Integer> right = Arrays.asList(1, 2, 3).stream();
|
||||
Stream<Integer> left = Stream.of(1, 2, 4);
|
||||
Stream<Integer> right = Stream.of(1, 2, 3);
|
||||
|
||||
//when
|
||||
List<Integer> rightCollected = right.collect(Collectors.toList());
|
||||
|
@ -172,7 +172,7 @@ public class JOOLTest {
|
|||
@Test
|
||||
public void givenOperationThatThrowsCheckedException_whenExecuteAndNeedToWrapCheckedIntoUnchecked_shouldPass() {
|
||||
//when
|
||||
List<Integer> collect = Arrays.asList("a", "b", "c").stream().map(elem -> {
|
||||
List<Integer> collect = Stream.of("a", "b", "c").map(elem -> {
|
||||
try {
|
||||
return methodThatThrowsChecked(elem);
|
||||
} catch (Exception e) {
|
||||
|
@ -192,7 +192,7 @@ public class JOOLTest {
|
|||
@Test
|
||||
public void givenOperationThatThrowsCheckedException_whenExecuteUsingUncheckedFuction_shouldPass() {
|
||||
//when
|
||||
List<Integer> collect = Arrays.asList("a", "b", "c").stream()
|
||||
List<Integer> collect = Stream.of("a", "b", "c")
|
||||
.map(Unchecked.function(elem -> methodThatThrowsChecked(elem)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -65,6 +65,7 @@
|
|||
<module>jaxb</module>
|
||||
<module>jee7</module>
|
||||
<module>jjwt</module>
|
||||
<module>jooq</module>
|
||||
<module>jpa-storedprocedure</module>
|
||||
<module>jsf</module>
|
||||
<module>json-path</module>
|
||||
|
@ -193,7 +194,6 @@
|
|||
|
||||
<module>struts2</module>
|
||||
<module>apache-velocity</module>
|
||||
<module>jooq</module>
|
||||
|
||||
|
||||
</modules>
|
||||
|
|
Loading…
Reference in New Issue