source: josm/trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java @ 12557

Last change on this file since 12557 was 12557, checked in by Don-vip, 2 weeks ago

see #15102 - first batch of HTTP unit tests mocking, using WireMock 2.7.1

  • 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.preferences.imagery;
3
4import static org.junit.Assert.assertNotNull;
5
6import java.io.File;
7import java.util.Arrays;
8
9import org.junit.Rule;
10import org.junit.Test;
11import org.openstreetmap.josm.Main;
12import org.openstreetmap.josm.TestUtils;
13import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
14import org.openstreetmap.josm.testutils.JOSMTestRules;
15
16import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
17
18/**
19 * Unit tests of {@link ImageryPreference} class.
20 */
21public class ImageryPreferenceTest {
22
23    /**
24     * Setup tests
25     */
26    @Rule
27    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
28    public JOSMTestRules test = new JOSMTestRules().platform().mainMenu();
29
30    /**
31     * Unit test of {@link ImageryPreference#ImageryPreference}.
32     */
33    @Test
34    public void testImageryPreference() {
35        assertNotNull(new ImageryPreference.Factory().createPreferenceSetting());
36    }
37
38    /**
39     * Unit test of {@link ImageryPreference#addGui}.
40     */
41    @Test
42    public void testAddGui() {
43        String fileUrl = new File(TestUtils.getTestDataRoot()+"__files/imagery/maps.xml").toURI().toString();
44        Main.pref.putCollection("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.