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