source: josm/trunk/test/unit/org/openstreetmap/josm/command/conflict/TagConflictResolveCommandTest.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.9 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.data.osm.Way;
12import org.openstreetmap.josm.gui.layer.OsmDataLayer;
13import org.openstreetmap.josm.testutils.JOSMTestRules;
14
15import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16import nl.jqno.equalsverifier.EqualsVerifier;
17import nl.jqno.equalsverifier.Warning;
18
19/**
20 * Unit tests of {@link TagConflictResolveCommand} class.
21 */
22class TagConflictResolveCommandTest {
23
24 /**
25 * Setup test.
26 */
27 @RegisterExtension
28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
29 public JOSMTestRules test = new JOSMTestRules();
30
31 /**
32 * Unit test of methods {@link TagConflictResolveCommand#equals} and {@link TagConflictResolveCommand#hashCode}.
33 */
34 @Test
35 void testEqualsContract() {
36 TestUtils.assumeWorkingEqualsVerifier();
37 EqualsVerifier.forClass(TagConflictResolveCommand.class).usingGetClass()
38 .withPrefabValues(Conflict.class,
39 new Conflict<>(new Node(), new Node()), new Conflict<>(new Way(), new Way()))
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.