source: josm/trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.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.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.tagging.presets.items;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertFalse;
6import static org.junit.jupiter.api.Assertions.assertTrue;
7
8import java.util.Collections;
9
10import javax.swing.JPanel;
11
12import org.junit.jupiter.api.BeforeAll;
13import org.junit.jupiter.api.Test;
14import org.openstreetmap.josm.JOSMFixture;
15import org.openstreetmap.josm.data.osm.OsmPrimitive;
16
17/**
18 * Unit tests of {@link Space} class.
19 */
20class SpaceTest {
21
22 /**
23 * Setup test.
24 */
25 @BeforeAll
26 public static void setUp() {
27 JOSMFixture.createUnitTestFixture().init();
28 }
29
30 /**
31 * Unit test for {@link Space#addToPanel}.
32 */
33 @Test
34 void testAddToPanel() {
35 JPanel p = new JPanel();
36 assertEquals(0, p.getComponentCount());
37 assertFalse(new Space().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));
38 assertTrue(p.getComponentCount() > 0);
39 }
40}
Note: See TracBrowser for help on using the repository browser.