source: josm/trunk/test/unit/org/openstreetmap/josm/command/TransformNodesCommandTest.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

File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.command;
3
4import org.junit.jupiter.api.extension.RegisterExtension;
5import org.junit.jupiter.api.Test;
6import org.openstreetmap.josm.TestUtils;
7import org.openstreetmap.josm.data.coor.LatLon;
8import org.openstreetmap.josm.data.osm.DataSet;
9import org.openstreetmap.josm.data.osm.User;
10import org.openstreetmap.josm.gui.layer.OsmDataLayer;
11import org.openstreetmap.josm.testutils.JOSMTestRules;
12
13import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14import nl.jqno.equalsverifier.EqualsVerifier;
15import nl.jqno.equalsverifier.Warning;
16
17/**
18 * Unit tests of {@link TransformNodesCommand} class.
19 */
20class TransformNodesCommandTest {
21
22 /**
23 * Setup test.
24 */
25 @RegisterExtension
26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
27 public JOSMTestRules test = new JOSMTestRules();
28
29 /**
30 * Unit test of methods {@link TransformNodesCommand#equals} and {@link TransformNodesCommand#hashCode}.
31 */
32 @Test
33 void testEqualsContract() {
34 TestUtils.assumeWorkingEqualsVerifier();
35 EqualsVerifier.forClass(TransformNodesCommand.class).usingGetClass()
36 .withPrefabValues(LatLon.class,
37 LatLon.ZERO, new LatLon(45, 45))
38 .withPrefabValues(DataSet.class,
39 new DataSet(), new DataSet())
40 .withPrefabValues(User.class,
41 User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
42 .withPrefabValues(OsmDataLayer.class,
43 new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
44 .suppress(Warning.NONFINAL_FIELDS)
45 .verify();
46 }
47}
Note: See TracBrowser for help on using the repository browser.