source: josm/trunk/test/unit/org/openstreetmap/josm/tools/StreamUtilsTest.java

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.
2package org.openstreetmap.josm.tools;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5
6import java.util.Arrays;
7import java.util.stream.Collectors;
8
9import net.trajano.commons.testing.UtilityClassTestUtil;
10import org.junit.jupiter.api.Test;
11
12/**
13 * Unit tests of {@link StreamUtils} class.
14 */
15class 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.