Skip to content

Commit d77ca20

Browse files
BAEL-583 - adding asserts to test
1 parent dabdd5d commit d77ca20

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
package com.baeldung.java8;
22

33

4-
import org.assertj.core.condition.AnyOf;
5-
import org.hamcrest.Matchers;
6-
import org.junit.Assert;
74
import org.junit.Test;
85

96
import java.util.Arrays;
107
import java.util.List;
118
import java.util.Optional;
129

13-
import static org.hamcrest.Matchers.*;
14-
import static org.junit.Assert.*;
10+
import static org.hamcrest.Matchers.anyOf;
11+
import static org.hamcrest.Matchers.is;
12+
import static org.junit.Assert.assertThat;
13+
import static org.junit.Assert.assertTrue;
1514

1615
public class Java8FindAnyFindFirstTest {
1716

@@ -22,7 +21,7 @@ public void createStream_whenFindAnyResultIsPresent_thenCorrect() {
2221

2322
Optional<String> result = list.stream().findAny();
2423

25-
assert result.isPresent();
24+
assertTrue(result.isPresent());
2625
assertThat(result.get(), anyOf(is("A"), is("B"), is("C"), is("D")));
2726
}
2827

@@ -33,7 +32,7 @@ public void createStream_whenFindFirstResultIsPresent_thenCorrect() {
3332

3433
Optional<String> result = list.stream().findFirst();
3534

36-
assert result.isPresent();
35+
assertTrue(result.isPresent());
3736
assertThat(result.get(),is("A"));
3837
}
3938
}

0 commit comments

Comments
 (0)