diff --git a/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java b/test/unit/org/openstreetmap/josm/actions/UploadActionTest.java
index f6a9c9dc50..b686fbb298 100644
a
|
b
|
import java.awt.GraphicsEnvironment;
|
9 | 9 | import java.util.Collections; |
10 | 10 | import java.util.concurrent.TimeUnit; |
11 | 11 | |
12 | | import org.junit.Ignore; |
| 12 | import org.junit.jupiter.api.BeforeAll; |
13 | 13 | import org.junit.jupiter.api.Test; |
14 | 14 | import org.junit.jupiter.api.extension.RegisterExtension; |
15 | 15 | import org.openstreetmap.josm.TestUtils; |
… |
… |
import org.openstreetmap.josm.testutils.JOSMTestRules;
|
26 | 26 | import org.openstreetmap.josm.testutils.annotations.BasicPreferences; |
27 | 27 | import org.openstreetmap.josm.testutils.mockers.WindowMocker; |
28 | 28 | import org.openstreetmap.josm.tools.Logging; |
| 29 | import org.openstreetmap.josm.tools.Territories; |
29 | 30 | |
30 | 31 | import mockit.Invocation; |
31 | 32 | import mockit.Mock; |
… |
… |
import mockit.MockUp;
|
38 | 39 | @BasicPreferences |
39 | 40 | class UploadActionTest { |
40 | 41 | // Only needed for layer cleanup. And user identity cleanup. And ensuring that data isn't accidentally uploaded. |
| 42 | // Note that the setUp method can be replaced by the @Territories extension, when that is merged. |
41 | 43 | @RegisterExtension |
42 | 44 | JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeAPI(); |
43 | 45 | |
| 46 | @BeforeAll |
| 47 | static void setUp() { |
| 48 | // Territories is needed due to test pollution. One of the listeners |
| 49 | // that may get registered on SelectionEventManager requires |
| 50 | // Territories. Rather unfortunately, we also need the external data to |
| 51 | // avoid the NPE. |
| 52 | Territories.initialize(); |
| 53 | } |
44 | 54 | /** |
45 | 55 | * Non-regression test for JOSM #21476. |
46 | 56 | */ |
47 | 57 | @Test |
48 | | @Ignore("doesn't work on CI") |
49 | 58 | void testNonRegression21476() { |
50 | 59 | TestUtils.assumeWorkingJMockit(); |
51 | 60 | Logging.clearLastErrorAndWarnings(); |