1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.gpx;
|
---|
3 |
|
---|
4 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
5 | import org.junit.jupiter.api.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 WithAttributes}.
|
---|
15 | */
|
---|
16 | class WithAttributesTest {
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * Setup test.
|
---|
20 | */
|
---|
21 | @RegisterExtension
|
---|
22 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
23 | public JOSMTestRules test = new JOSMTestRules();
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Unit test of methods {@link WithAttributes#equals} and {@link WithAttributes#hashCode}.
|
---|
27 | */
|
---|
28 | @Test
|
---|
29 | void testEqualsContract() {
|
---|
30 | TestUtils.assumeWorkingEqualsVerifier();
|
---|
31 | GpxExtensionCollection col = new GpxExtensionCollection();
|
---|
32 | col.add("josm", "from-server", "true");
|
---|
33 | EqualsVerifier.forClass(WithAttributes.class).usingGetClass()
|
---|
34 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
35 | .withPrefabValues(GpxExtensionCollection.class, new GpxExtensionCollection(), col)
|
---|
36 | .verify();
|
---|
37 | }
|
---|
38 | }
|
---|