1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.gpx;
|
---|
3 |
|
---|
4 | import org.junit.Rule;
|
---|
5 | import org.junit.Test;
|
---|
6 | import org.openstreetmap.josm.TestUtils;
|
---|
7 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
8 |
|
---|
9 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
10 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
11 | import nl.jqno.equalsverifier.Warning;
|
---|
12 |
|
---|
13 | /**
|
---|
14 | * Unit tests for class {@link WayPoint}.
|
---|
15 | */
|
---|
16 | public class WayPointTest {
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Setup test.
|
---|
20 | */
|
---|
21 | @Rule
|
---|
22 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
23 | public JOSMTestRules test = new JOSMTestRules();
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Unit test of methods {@link WayPoint#equals} and {@link WayPoint#hashCode}.
|
---|
27 | */
|
---|
28 | @Test
|
---|
29 | public void testEqualsContract() {
|
---|
30 | TestUtils.assumeWorkingEqualsVerifier();
|
---|
31 | GpxExtensionCollection col = new GpxExtensionCollection();
|
---|
32 | col.add("josm", "from-server", "true");
|
---|
33 | EqualsVerifier.forClass(WayPoint.class).usingGetClass()
|
---|
34 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
35 | .withIgnoredFields("customColoring", "dir", "drawLine", "east", "north", "eastNorthCacheKey")
|
---|
36 | .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
|
---|
37 | .verify();
|
---|
38 | }
|
---|
39 | }
|
---|