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