Commit 1c4e1dc8 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

returned value should be a list not a string

parent f84e94a2
......@@ -102,12 +102,13 @@ public class OverlayRestImpl extends BaseRestImpl {
return result;
}
private String getDeprecatedColumns(Layout overlay) {
private List<String> getDeprecatedColumns(Layout overlay) {
try {
String result = "";
List<String> result = new ArrayList<>();
for (ColorSchemaColumn column : new ColorSchemaReader().getDeprecatedColumns(overlay)) {
result += column.name() + ",";
result.add(column.name());
}
logger.debug(result);
return result;
} catch (IOException | InvalidColorSchemaException e) {
throw new InvalidStateException(e);
......
package lcsb.mapviewer.web;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
......@@ -1051,12 +1051,11 @@ public class OverlayControllerIntegrationTest extends ControllerIntegrationTest
String response = mockMvc.perform(request)
.andExpect(status().is2xxSuccessful())
.andReturn().getResponse().getContentAsString();
String deprecatedColumns = new JsonParser()
int deprecatedColumns = new JsonParser()
.parse(response)
.getAsJsonObject().get("deprecatedColumns").getAsString();
.getAsJsonObject().get("deprecatedColumns").getAsJsonArray().size();
assertNotNull(deprecatedColumns);
assertFalse(deprecatedColumns.isEmpty());
assertEquals(2, deprecatedColumns);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment