|
7 | 7 | import cucumber.deps.com.thoughtworks.xstream.io.HierarchicalStreamReader;
|
8 | 8 | import cucumber.runtime.CucumberException;
|
9 | 9 | import cucumber.runtime.ParameterInfo;
|
10 |
| -import cucumber.runtime.table.CamelCaseStringConverter; |
11 |
| -import cucumber.runtime.table.StringConverter; |
12 | 10 | import cucumber.runtime.xstream.CellWriter;
|
13 | 11 | import cucumber.runtime.xstream.ComplexTypeWriter;
|
14 | 12 | import cucumber.runtime.xstream.ListOfComplexTypeReader;
|
|
22 | 20 | import java.lang.reflect.Type;
|
23 | 21 | import java.util.ArrayList;
|
24 | 22 | import java.util.Collections;
|
25 |
| -import java.util.HashMap; |
| 23 | +import java.util.LinkedHashMap; |
26 | 24 | import java.util.List;
|
27 | 25 | import java.util.Map;
|
28 | 26 |
|
@@ -175,7 +173,7 @@ public <K, V> Map<K, V> toMap(DataTable dataTable, Type keyType, Type valueType)
|
175 | 173 | throw new CucumberException(String.format("Can't convert DataTable to Map<%s,%s>", keyType, valueType));
|
176 | 174 | }
|
177 | 175 |
|
178 |
| - Map<K, V> result = new HashMap<K, V>(); |
| 176 | + Map<K, V> result = new LinkedHashMap<K, V>(); |
179 | 177 | for (List<String> row : dataTable.raw()) {
|
180 | 178 | if (row.size() != 2) {
|
181 | 179 | throw new CucumberException("A DataTable can only be converted to a Map when there are 2 columns");
|
@@ -208,7 +206,7 @@ public <K, V> List<Map<K, V>> toMaps(DataTable dataTable, Type keyType, Type val
|
208 | 206 | }
|
209 | 207 | List<List<String>> valueRows = dataTable.cells(1);
|
210 | 208 | for (List<String> valueRow : valueRows) {
|
211 |
| - Map<K, V> map = new HashMap<K, V>(); |
| 209 | + Map<K, V> map = new LinkedHashMap<K, V>(); |
212 | 210 | int i = 0;
|
213 | 211 | for (String cell : valueRow) {
|
214 | 212 | map.put(keys.get(i), (V) valueConverter.fromString(cell));
|
|
0 commit comments