source: josm/trunk/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java@ 17531

Last change on this file since 17531 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: 2.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5
6import org.junit.jupiter.api.extension.RegisterExtension;
7import org.junit.jupiter.api.Test;
8import org.openstreetmap.josm.io.UploadStrategy;
9import org.openstreetmap.josm.io.UploadStrategySpecification;
10import org.openstreetmap.josm.testutils.JOSMTestRules;
11
12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13
14/**
15 * Unit tests of {@link UploadStrategySelectionPanel} class.
16 */
17class UploadStrategySelectionPanelTest {
18
19 /**
20 * Setup tests
21 */
22 @RegisterExtension
23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
24 public JOSMTestRules test = new JOSMTestRules().preferences().devAPI();
25
26 /**
27 * Test of {@link UploadStrategySelectionPanel#UploadStrategySelectionPanel}.
28 */
29 @Test
30 void testUploadStrategySelectionPanel() {
31 UploadStrategySelectionPanel p = new UploadStrategySelectionPanel();
32 p.setNumUploadedObjects(Integer.MAX_VALUE);
33 p.rememberUserInput();
34 p.initFromPreferences();
35 p.initEditingOfChunkSize();
36 }
37
38 /**
39 * Test of {@link UploadStrategySelectionPanel#setUploadStrategySpecification}
40 * / {@link UploadStrategySelectionPanel#getUploadStrategySpecification}.
41 */
42 @Test
43 void testUploadStrategySpecification() {
44 UploadStrategySelectionPanel p = new UploadStrategySelectionPanel();
45
46 UploadStrategySpecification def = new UploadStrategySpecification();
47 assertEquals(def, p.getUploadStrategySpecification());
48 p.setUploadStrategySpecification(null);
49 assertEquals(def, p.getUploadStrategySpecification());
50
51 UploadStrategySpecification strat = new UploadStrategySpecification().setStrategy(UploadStrategy.INDIVIDUAL_OBJECTS_STRATEGY);
52 p.setUploadStrategySpecification(strat);
53 assertEquals(strat, p.getUploadStrategySpecification());
54 }
55}
Note: See TracBrowser for help on using the repository browser.