BAEL-602 use Stream.of

This commit is contained in:
Tomasz Lelek 2017-02-23 16:03:49 +01:00
parent 08ced40547
commit 0fcae56196
2 changed files with 5 additions and 5 deletions

View File

@ -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());

View File

@ -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>