source: josm/trunk/test/functional/org/openstreetmap/josm/gui/GettingStartedTest.java@ 17275

Last change on this file since 17275 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

File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui;
3
4import static org.junit.jupiter.api.Assertions.assertNotEquals;
5
6import java.io.IOException;
7
8import org.junit.jupiter.api.Test;
9import org.junit.jupiter.api.BeforeAll;
10import org.junit.jupiter.api.Disabled;
11import org.openstreetmap.josm.JOSMFixture;
12
13/**
14 * Tests the {@link GettingStarted} class.
15 */
16class GettingStartedTest {
17
18 /**
19 * Setup test.
20 */
21 @BeforeAll
22 public static void init() {
23 JOSMFixture.createFunctionalTestFixture().init();
24 }
25
26 /**
27 * Tests that image links are replaced.
28 *
29 * @throws IOException if any I/O error occurs
30 */
31 @Test
32 @Disabled("see #15240, inactive for /browser/trunk/nodist/images/download.png")
33 void testImageReplacement() throws IOException {
34 final String motd = new GettingStarted.MotdContent().updateIfRequiredString();
35 // assuming that the MOTD contains one image included, fixImageLinks changes the HTML string
36 assertNotEquals(GettingStarted.fixImageLinks(motd), motd);
37 }
38
39 /**
40 * Tests that image links are replaced.
41 */
42 @Test
43 void testImageReplacementStatic() {
44 final String html = "the download button <img src=\"/browser/trunk/resources/images/download.svg?format=raw\" " +
45 "alt=\"source:trunk/resources/images/download.svg\" title=\"source:trunk/resources/images/download.svg\" />.";
46 assertNotEquals(GettingStarted.fixImageLinks(html), html);
47 }
48}
Note: See TracBrowser for help on using the repository browser.