1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.preferences.advanced;
|
---|
3 |
|
---|
4 | import java.util.Collections;
|
---|
5 |
|
---|
6 | import javax.swing.JOptionPane;
|
---|
7 |
|
---|
8 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
9 | import org.junit.jupiter.api.Test;
|
---|
10 | import org.openstreetmap.josm.TestUtils;
|
---|
11 | import org.openstreetmap.josm.data.Preferences;
|
---|
12 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
13 | import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
|
---|
14 |
|
---|
15 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Unit tests of {@link ExportProfileAction} class.
|
---|
19 | */
|
---|
20 | class 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 | }
|
---|