1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.command;
|
---|
3 |
|
---|
4 | import org.junit.BeforeClass;
|
---|
5 | import org.junit.Test;
|
---|
6 | import org.openstreetmap.josm.JOSMFixture;
|
---|
7 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
8 | import org.openstreetmap.josm.data.osm.User;
|
---|
9 | import org.openstreetmap.josm.gui.layer.OsmDataLayer;
|
---|
10 |
|
---|
11 | import nl.jqno.equalsverifier.EqualsVerifier;
|
---|
12 | import nl.jqno.equalsverifier.Warning;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Unit tests of {@link ChangePropertyKeyCommand} class.
|
---|
16 | */
|
---|
17 | public class ChangePropertyKeyCommandTest {
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Setup test.
|
---|
21 | */
|
---|
22 | @BeforeClass
|
---|
23 | public static void setUpBeforeClass() {
|
---|
24 | JOSMFixture.createUnitTestFixture().init(false);
|
---|
25 | }
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * Unit test of methods {@link ChangePropertyKeyCommand#equals} and {@link ChangePropertyKeyCommand#hashCode}.
|
---|
29 | */
|
---|
30 | @Test
|
---|
31 | public void equalsContract() {
|
---|
32 | EqualsVerifier.forClass(ChangePropertyKeyCommand.class).usingGetClass()
|
---|
33 | .withPrefabValues(DataSet.class,
|
---|
34 | new DataSet(), new DataSet())
|
---|
35 | .withPrefabValues(User.class,
|
---|
36 | User.createOsmUser(1, "foo"), User.createOsmUser(2, "bar"))
|
---|
37 | .withPrefabValues(OsmDataLayer.class,
|
---|
38 | new OsmDataLayer(new DataSet(), "1", null), new OsmDataLayer(new DataSet(), "2", null))
|
---|
39 | .suppress(Warning.NONFINAL_FIELDS)
|
---|
40 | .verify();
|
---|
41 | }
|
---|
42 | }
|
---|