source: josm/trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxExtensionTest.java@ 17442

Last change on this file since 17442 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.6 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.gpx;
3
4import org.junit.jupiter.api.extension.RegisterExtension;
5import org.junit.jupiter.api.Test;
6import org.openstreetmap.josm.TestUtils;
7import org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerActionTest;
8import org.openstreetmap.josm.io.GpxReaderTest;
9import org.openstreetmap.josm.io.GpxWriterTest;
10import org.openstreetmap.josm.testutils.JOSMTestRules;
11
12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13import nl.jqno.equalsverifier.EqualsVerifier;
14import nl.jqno.equalsverifier.Warning;
15
16/**
17 * Unit tests for class {@link GpxExtension}
18 */
19class GpxExtensionTest {
20
21 /**
22 * Setup test.
23 */
24 @RegisterExtension
25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
26 public JOSMTestRules test = new JOSMTestRules();
27
28 /**
29 * Unit test of methods {@link GpxExtension#equals} and {@link GpxExtension#hashCode}.
30 * @see GpxWriterTest#testExtensions()
31 * @see GpxReaderTest#testLayerPrefs()
32 * @see ConvertToDataLayerActionTest#testFromTrack()
33 */
34 @Test
35 void testEqualsContract() {
36 TestUtils.assumeWorkingEqualsVerifier();
37 GpxExtensionCollection col = new GpxExtensionCollection();
38 col.add("josm", "from-server", "true");
39 EqualsVerifier.forClass(GpxExtension.class).usingGetClass()
40 .suppress(Warning.NONFINAL_FIELDS)
41 .withIgnoredFields("qualifiedName", "parent")
42 .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
43 .verify();
44 }
45
46}
Note: See TracBrowser for help on using the repository browser.