Rev | Line | |
---|
[14810] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.io;
|
---|
| 3 |
|
---|
[17275] | 4 | import static org.junit.jupiter.api.Assertions.assertFalse;
|
---|
| 5 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
---|
[14810] | 6 |
|
---|
[17275] | 7 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
| 8 | import org.junit.jupiter.api.Test;
|
---|
[14810] | 9 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
| 10 |
|
---|
| 11 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
| 12 |
|
---|
| 13 | /**
|
---|
| 14 | * Unit tests of {@link OsmApiException} class.
|
---|
| 15 | */
|
---|
[17275] | 16 | class OsmApiExceptionTest {
|
---|
[14810] | 17 |
|
---|
| 18 | /**
|
---|
| 19 | * Setup tests
|
---|
| 20 | */
|
---|
[17275] | 21 | @RegisterExtension
|
---|
[14810] | 22 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
| 23 | public JOSMTestRules test = new JOSMTestRules().preferences();
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17328">Bug #17328</a>.
|
---|
| 27 | */
|
---|
| 28 | @Test
|
---|
[17275] | 29 | void testTicket17328() {
|
---|
[14810] | 30 | assertFalse(new OsmApiException(503, "foo", "bar").isHtml());
|
---|
| 31 | assertTrue(new OsmApiException(503, null, "<h2>This website is under heavy load (queue full)</h2><p>Sorry...</p>").isHtml());
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.