fixed broken tests

This commit is contained in:
Andreas Billmann
2016-09-23 11:14:45 +02:00
parent ef376d6c61
commit 5eaf021632
6 changed files with 126 additions and 47 deletions

View File

@@ -82,7 +82,7 @@ public class HeaderValidationTest {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Before
public void initialize() {
sut = new Validator(config);
sut = new Validator(config, new TestColumnValueProvider());
}
@@ -116,7 +116,21 @@ public class HeaderValidationTest {
}
public static String json(String... headerNames) {
return "{\"headers\":{\"list\":[" + asList(headerNames).stream().collect(joining(", ")) + "]}}";
String json = "{ \"fields\": [";
for (String headerName: headerNames) {
json += "{\"name\" : \""+headerName+"\" },";
}
if (headerNames != null && headerNames.length > 0) {
json = json.substring(0, json.length() - 1);
}
json += "]}";
return json;
}
}