Changeset 18690 in josm for trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java
- Timestamp:
- 2023-03-13T21:59:27+01:00 (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayTagCorrectorTest.java
r17289 r18690 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions.corrector; 3 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 import static org.junit.jupiter.api.Assertions.assertTrue; 3 7 4 8 import java.util.Collections; … … 7 11 import java.util.stream.Stream; 8 12 9 import org.junit.Assert;10 13 import org.junit.jupiter.api.Test; 11 14 import org.junit.jupiter.api.extension.RegisterExtension; … … 105 108 106 109 private void assertSwitch(Tag oldTag, Tag newTag) { 107 Assert.assertEquals(newTag, ReverseWayTagCorrector.TagSwitcher.apply(oldTag));110 assertEquals(newTag, ReverseWayTagCorrector.TagSwitcher.apply(oldTag)); 108 111 } 109 112 … … 128 131 void testSwitchingWayNodes() { 129 132 final Map<OsmPrimitive, List<TagCorrection>> tagCorrections = getTagCorrectionsForWay("direction=forward"); 130 Assert.assertEquals(1, tagCorrections.size());131 Assert.assertEquals(Collections.singletonList(new TagCorrection("direction", "forward", "direction", "backward")),133 assertEquals(1, tagCorrections.size()); 134 assertEquals(Collections.singletonList(new TagCorrection("direction", "forward", "direction", "backward")), 132 135 tagCorrections.values().iterator().next()); 133 136 } … … 138 141 @Test 139 142 void testNotSwitchingWayNodes() { 140 Assert.assertEquals(0, getTagCorrectionsForWay("direction=SSW").size());141 Assert.assertEquals(0, getTagCorrectionsForWay("direction=145").size());143 assertEquals(0, getTagCorrectionsForWay("direction=SSW").size()); 144 assertEquals(0, getTagCorrectionsForWay("direction=145").size()); 142 145 } 143 146 … … 148 151 void testIsReversible() { 149 152 Way w0 = buildWayWithMiddleNode("highway=stop"); 150 Assert.assertTrue(ReverseWayTagCorrector.isReversible(w0));153 assertTrue(ReverseWayTagCorrector.isReversible(w0)); 151 154 Way w1 = buildWayWithMiddleNode("direction=forward"); 152 Assert.assertFalse(ReverseWayTagCorrector.isReversible(w1));153 Assert.assertEquals(3, w1.getNodesCount());155 assertFalse(ReverseWayTagCorrector.isReversible(w1)); 156 assertEquals(3, w1.getNodesCount()); 154 157 w1.getNodes().forEach(n -> n.setKeys(null)); 155 Assert.assertTrue(ReverseWayTagCorrector.isReversible(w1));158 assertTrue(ReverseWayTagCorrector.isReversible(w1)); 156 159 w1.put("oneway", "yes"); 157 Assert.assertFalse(ReverseWayTagCorrector.isReversible(w1));160 assertFalse(ReverseWayTagCorrector.isReversible(w1)); 158 161 } 159 162
Note:
See TracChangeset
for help on using the changeset viewer.