Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.help;
|
---|
3 |
|
---|
4 | import static org.junit.jupiter.api.Assertions.assertFalse;
|
---|
5 | import static org.junit.jupiter.api.Assertions.assertThrows;
|
---|
6 |
|
---|
7 | import org.junit.jupiter.api.Test;
|
---|
8 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
9 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
10 |
|
---|
11 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Unit tests of {@link HelpContentReader} class.
|
---|
15 | */
|
---|
16 | class 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.