Commit 45385f7c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

visibility level is returned properly

parent 75bf2483
......@@ -115,7 +115,7 @@ public class ElementsRestImpl extends BaseRestImpl {
} else if (column.equals("formersymbols")) {
value = element.getFormerSymbols();
} else if (column.equals("hierarchyvisibilitylevel")) {
value = element.getFormerSymbols();
value = element.getVisibilityLevel();
} else if (column.equals("linkedsubmodel")) {
if (element.getSubmodel() != null) {
value = element.getSubmodel().getSubmodel().getId();
......
......@@ -3,6 +3,7 @@ package lcsb.mapviewer.api.projects.models.bioEntities.elements;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
......@@ -88,6 +89,21 @@ public class ElementRestImplTest extends RestTestFunctions {
}
}
@Test
public void testGetElementsVisibility() throws Exception {
try {
ElementsRestImpl elementRest = createMockElementRest("testFiles/model/sample.xml");
List<Map<String, Object>> result = elementRest.getElements("sample", "", "", "*", token.getId(), "");
for (Map<String, Object> map : result) {
assertTrue(map.get("hierarchyVisibilityLevel") instanceof String);
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@SuppressWarnings("unchecked")
@Test
public void testGetModificationsForProtein() throws Exception {
......
Supports Markdown
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