source: josm/trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.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.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.help;
3
4import static org.junit.jupiter.api.Assertions.assertFalse;
5import static org.junit.jupiter.api.Assertions.assertThrows;
6
7import org.junit.jupiter.api.Test;
8import org.junit.jupiter.api.extension.RegisterExtension;
9import org.openstreetmap.josm.testutils.JOSMTestRules;
10
11import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12
13/**
14 * Unit tests of {@link HelpContentReader} class.
15 */
16class HelpContentReaderTest {
17
18 /**
19 * Setup tests
20 */
21 @RegisterExtension
22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
23 public JOSMTestRules test = new JOSMTestRules().timeout(30000);
24
25 /**
26 * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - null case.
27 */
28 @Test
29 void testFetchHelpTopicContentNull() {
30 assertThrows(HelpContentReaderException.class, () -> new HelpContentReader(null).fetchHelpTopicContent(null, false));
31 }
32
33 /**
34 * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - nominal case.
35 * @throws HelpContentReaderException never
36 */
37 @Test
38 void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
39 String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false);
40 assertFalse(res.trim().isEmpty());
41 }
42}
Note: See TracBrowser for help on using the repository browser.