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