Ignore:
Timestamp:
2020-03-17T20:09:38+01:00 (17 months ago)
Author:
simon04
Message:

see #18948 - Use Collections.singletonMap instead of ImmutableMap.of

Location:
trunk/test/unit/org/openstreetmap/josm/gui/preferences
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileActionTest.java

    r14149 r16159  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.preferences.advanced;
     3
     4import java.util.Collections;
    35
    46import javax.swing.JOptionPane;
     
    1012import org.openstreetmap.josm.testutils.JOSMTestRules;
    1113import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
    12 
    13 import com.google.common.collect.ImmutableMap;
    1414
    1515import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    3232    public void testAction() {
    3333        TestUtils.assumeWorkingJMockit();
    34         new JOptionPaneSimpleMocker(ImmutableMap.of(
     34        new JOptionPaneSimpleMocker(Collections.singletonMap(
    3535            "All the preferences of this group are default, nothing to save", JOptionPane.OK_OPTION
    3636        ));
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java

    r14213 r16159  
    1212import java.nio.file.Files;
    1313import java.util.Collection;
     14import java.util.Collections;
    1415
    1516import javax.swing.JOptionPane;
     
    3536import com.github.tomakehurst.wiremock.junit.WireMockRule;
    3637import com.google.common.collect.ImmutableList;
    37 import com.google.common.collect.ImmutableMap;
    3838
    3939import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    137137            new PluginServer.RemotePlugin(this.referenceDummyJarNew),
    138138            new PluginServer.RemotePlugin(this.referenceBazJarOld),
    139             new PluginServer.RemotePlugin(null, ImmutableMap.of("Plugin-Version", "2"), "irrelevant_plugin")
     139            new PluginServer.RemotePlugin(null, Collections.singletonMap("Plugin-Version", "2"), "irrelevant_plugin")
    140140        );
    141141        pluginServer.applyToWireMockServer(this.pluginServerRule);
     
    143143
    144144        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
    145             ImmutableMap.<String, Object>of(
     145            Collections.singletonMap(
    146146                "<html>The following plugin has been downloaded <strong>successfully</strong>:"
    147147                + "<ul><li>baz_plugin (6)</li></ul>"
     
    268268
    269269        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
    270             ImmutableMap.<String, Object>of(
     270            Collections.singletonMap(
    271271                "<html>You have to restart JOSM for some settings to take effect."
    272272                + "<br/><br/>Would you like to restart now?</html>",
     
    581581            new PluginServer.RemotePlugin(this.referenceDummyJarOld),
    582582            new PluginServer.RemotePlugin(this.referenceBazJarOld),
    583             new PluginServer.RemotePlugin(null, ImmutableMap.of("Plugin-Version", "123"), "irrelevant_plugin")
     583            new PluginServer.RemotePlugin(null, Collections.singletonMap("Plugin-Version", "123"), "irrelevant_plugin")
    584584        );
    585585        pluginServer.applyToWireMockServer(this.pluginServerRule);
     
    587587
    588588        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(
    589             ImmutableMap.<String, Object>of(
     589            Collections.singletonMap(
    590590                "All installed plugins are up to date. JOSM does not have to download newer versions.",
    591591                "OK"
     
    740740
    741741        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker();
    742         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(ImmutableMap.<String, Object>of(
     742        final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(Collections.singletonMap(
    743743            "<html>The following plugin has been downloaded <strong>successfully</strong>:"
    744744            + "<ul><li>dummy_plugin (31772)</li></ul></html>",
     
    845845        final PluginServer pluginServer = new PluginServer(
    846846            new PluginServer.RemotePlugin(this.referenceDummyJarNew),
    847             new PluginServer.RemotePlugin(this.referenceBazJarNew, ImmutableMap.of(
     847            new PluginServer.RemotePlugin(this.referenceBazJarNew, Collections.singletonMap(
    848848                "6800_Plugin-Url", "6;http://localhost:" + this.pluginServerRule.port() + bazOldServePath
    849849            ))
     
    860860        Config.getPref().putList("plugins", ImmutableList.of());
    861861
    862         final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(ImmutableMap.of(
     862        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(Collections.singletonMap(
    863863            "<html>The following plugin has been downloaded <strong>successfully</strong>:"
    864864            + "<ul><li>baz_plugin (6)</li></ul>"
Note: See TracChangeset for help on using the changeset viewer.