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

Last change on this file since 17360 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import org.junit.jupiter.api.extension.RegisterExtension;
5import org.junit.jupiter.api.Test;
6import org.openstreetmap.josm.testutils.JOSMTestRules;
7
8import static org.junit.jupiter.api.Assertions.assertEquals;
9
10import java.util.Arrays;
11import java.util.stream.Collectors;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14import net.trajano.commons.testing.UtilityClassTestUtil;
15
16/**
17 * Unit tests of {@link StreamUtils} class.
18 */
19class StreamUtilsTest {
20
21 /**
22 * Setup rule.
23 */
24 @RegisterExtension
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules();
27
28 /**
29 * Tests that {@code StreamUtils} satisfies utility class criteria.
30 * @throws ReflectiveOperationException if an error occurs
31 */
32 @Test
33 void testUtilityClass() throws ReflectiveOperationException {
34 UtilityClassTestUtil.assertUtilityClassWellDefined(StreamUtils.class);
35 }
36
37 /**
38 * Tests {@link StreamUtils#reversedStream(java.util.List)}
39 */
40 @Test
41 void testReverseStream() {
42 assertEquals("baz/bar/foo",
43 StreamUtils.reversedStream(Arrays.asList("foo", "bar", "baz")).collect(Collectors.joining("/")));
44 }
45}
Note: See TracBrowser for help on using the repository browser.