Commit c1790c82 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

don't call dao in integration test

parent 93a12b0f
......@@ -58,7 +58,6 @@ import lcsb.mapviewer.model.map.model.SubmodelType;
import lcsb.mapviewer.model.security.Privilege;
import lcsb.mapviewer.model.security.PrivilegeType;
import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.persist.dao.ProjectDao;
import lcsb.mapviewer.services.interfaces.IProjectService;
import lcsb.mapviewer.services.interfaces.IUserService;
import lcsb.mapviewer.web.serialization.ProjectBackgroundUpdateMixIn;
......@@ -77,9 +76,6 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
@Autowired
private IProjectService projectService;
@Autowired
private ProjectDao projectDao;
@Autowired
private ProjectSnippets snippets;
......@@ -90,10 +86,7 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
@Before
public void setup() {
callInSeparateThreadNoReturn(() -> {
curator = createCurator(CURATOR_LOGIN, CURATOR_PASSWORD);
});
curator = createCurator(CURATOR_LOGIN, CURATOR_PASSWORD);
}
@After
......@@ -143,9 +136,7 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
userService.grantUserPrivilege(curator, PrivilegeType.READ_PROJECT, project.getProjectId());
Project project2 = new Project(TEST_PROJECT_2);
project2.setOwner(userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN));
callInSeparateThreadNoReturn(() -> {
projectDao.add(project2);
});
projectService.add(project2);
MockHttpSession session = createSession(CURATOR_LOGIN, CURATOR_PASSWORD);
......@@ -276,11 +267,8 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
.type("string"))))
.andExpect(status().is2xxSuccessful());
callInSeparateThread(() -> {
assertTrue(userService.getUserByLogin(CURATOR_LOGIN).getPrivileges()
.contains(new Privilege(PrivilegeType.READ_PROJECT, TEST_PROJECT)));
return null;
});
assertTrue(userService.getUserByLogin(CURATOR_LOGIN, true).getPrivileges()
.contains(new Privilege(PrivilegeType.READ_PROJECT, TEST_PROJECT)));
}
@Test
......@@ -1128,9 +1116,7 @@ public class ProjectControllerIntegrationTest extends ControllerIntegrationTest
backgroundPathParameters(),
responseFields()));
int backgrounds = callInSeparateThread(() -> {
return projectDao.getById(project.getId()).getProjectBackgrounds().size();
});
int backgrounds = projectService.getBackgrounds(project.getProjectId(), true).size();
assertEquals(project.getProjectBackgrounds().size() - 1, backgrounds);
}
......
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