Commit 491def44 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

tests fixed

parent 4a259098
Pipeline #23939 passed with stage
in 11 minutes and 42 seconds
......@@ -164,7 +164,7 @@ public class ConfigurationControllerIntegrationTest extends ControllerIntegratio
@Test
public void testRegisterExistingUser() throws Exception {
public void testRegisterExistingDapiUser() throws Exception {
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
UserDto user = new UserDto();
......
......@@ -33,7 +33,7 @@ import lcsb.mapviewer.common.UnitTestFailedWatcher;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.ProjectStatus;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.model.graphics.PolylineData;
import lcsb.mapviewer.model.graphics.*;
import lcsb.mapviewer.model.map.Comment;
import lcsb.mapviewer.model.map.layout.ColorSchemaType;
import lcsb.mapviewer.model.map.layout.Layout;
......@@ -203,19 +203,14 @@ abstract public class ControllerIntegrationTest {
map.setWidth(100);
map.setHeight(100);
Element element = new GenericProtein("p1");
element.setWidth(100.0);
element.setHeight(20.0);
element.setX(10);
element.setX(20);
element.setZ(2);
Glyph g = new Glyph();
g.setFile(file);
element.setGlyph(g);
Element element = createProtein();
Glyph glyph = new Glyph();
glyph.setFile(file);
element.setGlyph(glyph);
map.addElement(element);
project.addModel(map);
project.addGlyph(g);
project.addGlyph(glyph);
projectDao.add(project);
return project;
}
......@@ -233,12 +228,7 @@ abstract public class ControllerIntegrationTest {
reaction.setZ(2);
reaction.setLine(new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(10, 0)));
map.addReaction(reaction);
Element element = new GenericProtein("p1");
element.setWidth(100.0);
element.setHeight(20.0);
element.setX(10);
element.setX(20);
element.setZ(2);
Element element = createProtein();
map.addElement(element);
Reactant reactant = new Reactant(element);
......@@ -254,6 +244,19 @@ abstract public class ControllerIntegrationTest {
return project;
}
private GenericProtein createProtein() {
GenericProtein element = new GenericProtein("p1");
element.setWidth(100.0);
element.setHeight(20.0);
element.setX(10);
element.setX(20);
element.setZ(2);
element.setNamePoint(element.getCenter());
element.setNameHorizontalAlign(HorizontalAlign.CENTER);
element.setNameVerticalAlign(VerticalAlign.MIDDLE);
return element;
}
protected UploadedFileEntry createFile(String content, User user) {
return createFile(content.getBytes(), user);
}
......
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