Last change
on this file was 18037, checked in by Don-vip, 3 years ago |
fix #21064 - Add JUnit 5 extension for preferences (patch by taylor.smock)
|
-
Property svn:eol-style
set to
native
|
File size:
972 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
---|
5 |
|
---|
6 | import java.util.Arrays;
|
---|
7 | import java.util.stream.Collectors;
|
---|
8 |
|
---|
9 | import net.trajano.commons.testing.UtilityClassTestUtil;
|
---|
10 | import org.junit.jupiter.api.Test;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Unit tests of {@link StreamUtils} class.
|
---|
14 | */
|
---|
15 | class StreamUtilsTest {
|
---|
16 | /**
|
---|
17 | * Tests that {@code StreamUtils} satisfies utility class criteria.
|
---|
18 | * @throws ReflectiveOperationException if an error occurs
|
---|
19 | */
|
---|
20 | @Test
|
---|
21 | void testUtilityClass() throws ReflectiveOperationException {
|
---|
22 | UtilityClassTestUtil.assertUtilityClassWellDefined(StreamUtils.class);
|
---|
23 | }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Tests {@link StreamUtils#reversedStream(java.util.List)}
|
---|
27 | */
|
---|
28 | @Test
|
---|
29 | void testReverseStream() {
|
---|
30 | assertEquals("baz/bar/foo",
|
---|
31 | StreamUtils.reversedStream(Arrays.asList("foo", "bar", "baz")).collect(Collectors.joining("/")));
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.