source: josm/trunk/test/unit/org/openstreetmap/josm/data/gpx/WithAttributesTest.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.2 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.testutils.JOSMTestRules;
8
9import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
10import nl.jqno.equalsverifier.EqualsVerifier;
11import nl.jqno.equalsverifier.Warning;
12
13/**
14 * Unit tests for class {@link WithAttributes}.
15 */
16class 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}
Note: See TracBrowser for help on using the repository browser.