From 94fccf4c1177d90fb66075a08d4e701923a1025a Mon Sep 17 00:00:00 2001
From: Robert Scott <code@humanleg.org.uk>
Date: Thu, 1 Nov 2018 23:31:28 +0000
Subject: [PATCH v1 3/4] ChangesetCacheManagerTest: fix
testDownloadMyChangesets for non-headless mode
---
.../dialogs/changeset/ChangesetCacheManagerTest.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
index df518ea21..08456dae0 100644
|
a
|
b
|
|
| 1 | 1 | // License: GPL. For details, see LICENSE file. |
| 2 | 2 | package org.openstreetmap.josm.gui.dialogs.changeset; |
| 3 | 3 | |
| | 4 | import static org.junit.Assert.assertEquals; |
| 4 | 5 | import static org.junit.Assert.assertNotNull; |
| 5 | 6 | import static org.junit.Assert.assertTrue; |
| 6 | 7 | |
| … |
… |
import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.Remove
|
| 26 | 27 | import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager.ShowDetailAction; |
| 27 | 28 | import org.openstreetmap.josm.gui.dialogs.changeset.query.ChangesetQueryDialog; |
| 28 | 29 | import org.openstreetmap.josm.testutils.JOSMTestRules; |
| | 30 | import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker; |
| 29 | 31 | import org.openstreetmap.josm.testutils.mockers.WindowMocker; |
| 30 | 32 | |
| | 33 | import com.google.common.collect.ImmutableMap; |
| | 34 | |
| 31 | 35 | import mockit.Invocation; |
| 32 | 36 | import mockit.Mock; |
| 33 | 37 | import mockit.MockUp; |
| … |
… |
public class ChangesetCacheManagerTest {
|
| 114 | 118 | */ |
| 115 | 119 | @Test |
| 116 | 120 | public void testDownloadMyChangesets() { |
| | 121 | TestUtils.assumeWorkingJMockit(); |
| | 122 | final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker( |
| | 123 | ImmutableMap.<String, Object>of( |
| | 124 | "<html>JOSM is currently running with an anonymous user. It cannot download<br>" |
| | 125 | + "your changesets from the OSM server unless you enter your OSM user name<br>" |
| | 126 | + "in the JOSM preferences.</html>", |
| | 127 | "OK" |
| | 128 | ) |
| | 129 | ); |
| | 130 | |
| 117 | 131 | new DownloadMyChangesets().actionPerformed(null); |
| | 132 | |
| | 133 | assertEquals(1, haMocker.getInvocationLog().size()); |
| | 134 | Object[] invocationLogEntry = haMocker.getInvocationLog().get(0); |
| | 135 | assertEquals(0, (int) invocationLogEntry[0]); |
| | 136 | assertEquals("Warning", invocationLogEntry[2]); |
| 118 | 137 | } |
| 119 | 138 | |
| 120 | 139 | /** |