source: josm/trunk/test/unit/org/openstreetmap/josm/gui/io/DownloadPrimitivesTaskTest.java@ 17275

Last change on this file since 17275 was 17275, checked in by Don-vip, 3 years ago

see #16567 - upgrade almost all tests to JUnit 5, except those depending on WiremockRule

See https://github.com/tomakehurst/wiremock/issues/684

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import static org.junit.jupiter.api.Assertions.assertFalse;
5import static org.junit.jupiter.api.Assertions.assertNotNull;
6import static org.junit.jupiter.api.Assertions.assertTrue;
7
8import java.util.Arrays;
9
10import org.junit.jupiter.api.extension.RegisterExtension;
11import org.junit.jupiter.api.Test;
12import org.openstreetmap.josm.data.osm.DataSet;
13import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
14import org.openstreetmap.josm.data.osm.SimplePrimitiveId;
15import org.openstreetmap.josm.gui.layer.OsmDataLayer;
16import org.openstreetmap.josm.testutils.JOSMTestRules;
17
18import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
19
20/**
21 * Unit tests of {@link DownloadPrimitivesTask} class.
22 */
23class DownloadPrimitivesTaskTest {
24
25 /**
26 * Setup tests
27 */
28 @RegisterExtension
29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
30 public JOSMTestRules test = new JOSMTestRules().preferences().devAPI().timeout(20000);
31
32 /**
33 * Test of {@link DownloadPrimitivesTask} class.
34 */
35 @Test
36 void testDownloadPrimitivesTask() {
37 DataSet ds = new DataSet();
38 assertTrue(ds.allPrimitives().isEmpty());
39 SimplePrimitiveId pid = new SimplePrimitiveId(1, OsmPrimitiveType.NODE);
40 new DownloadPrimitivesTask(new OsmDataLayer(ds, "", null), Arrays.asList(pid), true).run();
41 assertFalse(ds.allPrimitives().isEmpty());
42 assertNotNull(ds.getPrimitiveById(pid));
43 }
44}
Note: See TracBrowser for help on using the repository browser.