source: josm/trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java@ 17536

Last change on this file since 17536 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.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.preferences.advanced;
3
4import java.util.Collections;
5
6import javax.swing.JOptionPane;
7
8import org.junit.jupiter.api.extension.RegisterExtension;
9import org.junit.jupiter.api.Test;
10import org.openstreetmap.josm.TestUtils;
11import org.openstreetmap.josm.data.Preferences;
12import org.openstreetmap.josm.testutils.JOSMTestRules;
13import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
14
15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16
17/**
18 * Unit tests of {@link ExportProfileAction} class.
19 */
20class ExportProfileActionTest {
21 /**
22 * Setup tests
23 */
24 @RegisterExtension
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
27
28 /**
29 * Unit test of {@link ExportProfileAction#actionPerformed}.
30 */
31 @Test
32 void testAction() {
33 TestUtils.assumeWorkingJMockit();
34 new JOptionPaneSimpleMocker(Collections.singletonMap(
35 "All the preferences of this group are default, nothing to save", JOptionPane.OK_OPTION
36 ));
37 new ExportProfileAction(Preferences.main(), "foo", "bar").actionPerformed(null);
38 new ExportProfileAction(Preferences.main(), "expert", "expert").actionPerformed(null);
39 }
40}
Note: See TracBrowser for help on using the repository browser.