Ignore:
Timestamp:
2020-03-17T20:09:41+01:00 (6 years ago)
Author:
simon04
Message:

see #18948 - Get rid of remaining ImmutableMap.of

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerMultiVersionTest.java

    r14213 r16160  
    99import java.io.File;
    1010import java.nio.file.Files;
     11import java.util.HashMap;
    1112import java.util.List;
     13import java.util.Map;
    1214
    1315import org.junit.Before;
     
    2527import com.github.tomakehurst.wiremock.junit.WireMockRule;
    2628import com.google.common.collect.ImmutableList;
    27 import com.google.common.collect.ImmutableMap;
    2829
    2930import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    9697
    9798        final String quxNewerServePath = "/qux/newer.jar";
     99        final Map<String, String> attrOverrides = new HashMap<String, String>() {{
     100            put("7500_Plugin-Url", "432;http://localhost:" + pluginServerRule.port() + quxNewerServePath);
     101            put("7499_Plugin-Url", "346;http://localhost:" + pluginServerRule.port() + "/not/served.jar");
     102            put("6999_Plugin-Url", "345;http://localhost:" + pluginServerRule.port() + "/not/served/eithejar");
     103        }};
    98104        final PluginServer pluginServer = new PluginServer(
    99105            new PluginServer.RemotePlugin(this.referenceBazJarOld),
    100             new PluginServer.RemotePlugin(this.referenceQuxJarNewest, ImmutableMap.of(
    101                 "7500_Plugin-Url", "432;http://localhost:" + this.pluginServerRule.port() + quxNewerServePath,
    102                 "7499_Plugin-Url", "346;http://localhost:" + this.pluginServerRule.port() + "/not/served.jar",
    103                 "6999_Plugin-Url", "345;http://localhost:" + this.pluginServerRule.port() + "/not/served/either.jar"
    104             ))
     106            new PluginServer.RemotePlugin(this.referenceQuxJarNewest, attrOverrides)
    105107        );
    106108        pluginServer.applyToWireMockServer(this.pluginServerRule);
     
    161163        TestUtils.assumeWorkingJMockit();
    162164
     165        final Map<String, String> attrOverrides = new HashMap<String, String>() {{
     166            put("7500_Plugin-Url", "432;http://localhost:" + pluginServerRule.port() + "/dont.jar");
     167            put("7499_Plugin-Url", "346;http://localhost:" + pluginServerRule.port() + "/even.jar");
     168            put("6999_Plugin-Url", "345;http://localhost:" + pluginServerRule.port() + "/bother.jar");
     169        }};
    163170        final PluginServer pluginServer = new PluginServer(
    164171            new PluginServer.RemotePlugin(this.referenceBazJarOld),
    165             new PluginServer.RemotePlugin(this.referenceQuxJarNewest, ImmutableMap.of(
    166                 "7500_Plugin-Url", "432;http://localhost:" + this.pluginServerRule.port() + "/dont.jar",
    167                 "7499_Plugin-Url", "346;http://localhost:" + this.pluginServerRule.port() + "/even.jar",
    168                 "6999_Plugin-Url", "345;http://localhost:" + this.pluginServerRule.port() + "/bother.jar"
    169             ))
     172            new PluginServer.RemotePlugin(this.referenceQuxJarNewest, attrOverrides)
    170173        );
    171174        pluginServer.applyToWireMockServer(this.pluginServerRule);
Note: See TracChangeset for help on using the changeset viewer.