source: josm/trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.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

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.preferences.imagery;
3
4import static org.junit.jupiter.api.Assertions.assertNotNull;
5
6import java.io.File;
7import java.util.Arrays;
8
9import org.junit.jupiter.api.extension.RegisterExtension;
10import org.junit.jupiter.api.Test;
11import org.openstreetmap.josm.TestUtils;
12import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
13import org.openstreetmap.josm.spi.preferences.Config;
14import org.openstreetmap.josm.testutils.JOSMTestRules;
15
16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
17
18/**
19 * Unit tests of {@link ImageryPreference} class.
20 */
21class ImageryPreferenceTest {
22
23 /**
24 * Setup tests
25 */
26 @RegisterExtension
27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
28 public JOSMTestRules test = new JOSMTestRules().main();
29
30 /**
31 * Unit test of {@link ImageryPreference#ImageryPreference}.
32 */
33 @Test
34 void testImageryPreference() {
35 assertNotNull(new ImageryPreference.Factory().createPreferenceSetting());
36 }
37
38 /**
39 * Unit test of {@link ImageryPreference#addGui}.
40 */
41 @Test
42 void testAddGui() {
43 String fileUrl = new File(TestUtils.getTestDataRoot()+"__files/imagery/maps.xml").toURI().toString();
44 Config.getPref().putList("imagery.layers.sites", Arrays.asList(fileUrl));
45 PreferencesTestUtils.doTestPreferenceSettingAddGui(new ImageryPreference.Factory(), null);
46 }
47}
Note: See TracBrowser for help on using the repository browser.