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

redundant definitions removed

parent d8bedcd9
Pipeline #29612 failed with stage
in 12 minutes and 10 seconds
......@@ -25,9 +25,6 @@ public class FileControllerIntegrationTestWithoutTransaction extends ControllerI
Logger logger = LogManager.getLogger();
private static final String BUILT_IN_TEST_ADMIN_PASSWORD = "admin";
private static final String BUILT_IN_TEST_ADMIN_LOGIN = "admin";
@Before
public void setup() {
}
......
......@@ -50,8 +50,7 @@ public class FunctionControllerIntegrationTest extends ControllerIntegrationTest
@Test
public void testGetFunctionListWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/functions/")
.session(session);
......@@ -62,8 +61,7 @@ public class FunctionControllerIntegrationTest extends ControllerIntegrationTest
@Test
public void testGetFunctionWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/functions/1")
.session(session);
......@@ -74,8 +72,7 @@ public class FunctionControllerIntegrationTest extends ControllerIntegrationTest
@Test
public void testGetFunctions() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}/functions/", TEST_PROJECT, "*")
.session(session);
......@@ -90,8 +87,7 @@ public class FunctionControllerIntegrationTest extends ControllerIntegrationTest
@Test
public void testGetFunction() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}/functions/{functionId}", TEST_PROJECT, "*",
map.getFunctions().iterator().next().getId())
......
......@@ -365,8 +365,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testGetAllElementsForUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/bioEntities/elements/").session(session);
......@@ -441,8 +440,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testSearchBioEntitiesByCoordinatesWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get(
"/projects/*/models/" + map.getId() + "/bioEntities:search?coordinates=104.36,182.81")
......@@ -454,8 +452,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testSearchBioEntitiesByQueryWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get(
"/projects/*/models/" + map.getId() + "/bioEntities:search?query=s1")
......@@ -505,8 +502,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testSuggestedQueryListWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/bioEntities/suggestedQueryList").session(session);
......@@ -516,8 +512,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testSuggestedQueryList() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}/bioEntities/suggestedQueryList", TEST_PROJECT,
"*").session(session);
......@@ -579,8 +574,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testGetMapByIdWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/" + map.getId()).session(session);
......@@ -590,8 +584,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testGetMapsWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/").session(session);
......@@ -601,8 +594,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testGetMapsWithForProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/", BUILT_IN_PROJECT).session(session);
......@@ -615,8 +607,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testUpdateMapWithMissingContent() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
String content = "{}";
......@@ -629,8 +620,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testUpdateMap() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
String content = "{\"model\":{\"defaultCenterX\":10, \"defaultCenterY\":20, \"defaultZoomLevel\":3}}";
......@@ -655,8 +645,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testUpdateMapWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
String content = "{\"model\":{}}";
......@@ -670,8 +659,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadImage() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}:downloadImage?" +
"handlerClass=" + PngImageGenerator.class.getCanonicalName(), TEST_PROJECT, map.getId())
......@@ -687,8 +675,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadImagePolygon() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}:downloadImage?" +
"handlerClass=" + PdfImageGenerator.class.getCanonicalName() +
......@@ -722,8 +709,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadImageWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/" + map.getId() + ":downloadImage?" +
"handlerClass=" + PngImageGenerator.class.getCanonicalName())
......@@ -736,8 +722,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModel() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}:downloadModel?" +
"handlerClass=" + CellDesignerXmlParser.class.getCanonicalName(), TEST_PROJECT, map.getId())
......@@ -765,8 +750,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModelByPolygon() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}:downloadModel?" +
"handlerClass=" + CellDesignerXmlParser.class.getCanonicalName() +
......@@ -783,8 +767,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModelByElementList() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}:downloadModel?" +
"handlerClass=" + CellDesignerXmlParser.class.getCanonicalName() +
......@@ -801,8 +784,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModelWarnings() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/" + TEST_PROJECT + "/models/" + map.getId() + ":downloadModelWarnings?" +
"handlerClass=" + SbgnmlXmlConverter.class.getCanonicalName())
......@@ -820,8 +802,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModelAsZip() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/" + TEST_PROJECT + "/models/" + map.getId() + ":downloadModel?" +
"handlerClass=" + CellDesignerXmlParser.class.getCanonicalName())
......@@ -837,8 +818,7 @@ public class MapControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testDownloadModelWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/" + map.getId() + ":downloadModel?" +
"handlerClass=" + CellDesignerXmlParser.class.getCanonicalName())
......
......@@ -50,8 +50,7 @@ public class ParameterControllerIntegrationTest extends ControllerIntegrationTes
@Test
public void testGetParameterListWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/parameters/")
.session(session);
......@@ -62,8 +61,7 @@ public class ParameterControllerIntegrationTest extends ControllerIntegrationTes
@Test
public void testGetParameterWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/parameters/1")
.session(session);
......@@ -74,8 +72,7 @@ public class ParameterControllerIntegrationTest extends ControllerIntegrationTes
@Test
public void testGetParameters() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}/parameters/", TEST_PROJECT, "*")
.session(session);
......@@ -90,8 +87,7 @@ public class ParameterControllerIntegrationTest extends ControllerIntegrationTes
@Test
public void testGetParameter() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/{projectId}/models/{mapId}/parameters/{parameterId}", TEST_PROJECT, "*",
map.getParameters().iterator().next().getId())
......
......@@ -39,8 +39,6 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
private static final String CURATOR_PASSWORD = "curator_pass";
private static final String CURATOR_LOGIN = "test_curator";
private static final String ADMIN_PASSWORD = "admin_pass";
private static final String ADMIN_LOGIN = "admin_user";
private static final String USER_PASSWORD = "user_pass";
private static final String USER_LOGIN = "test_user";
Logger logger = LogManager.getLogger();
......@@ -202,11 +200,11 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
@Test(timeout = 10000)
public void addProjectWithInvalidId() throws Exception {
User curator = createAdminInSeparateThread(ADMIN_LOGIN, ADMIN_PASSWORD);
User admin = userDao.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
try {
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
curator);
admin);
callInSeparateThread(() -> {
try {
......@@ -219,7 +217,7 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
RequestBuilder request = post("/projects/*")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(ADMIN_LOGIN, ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is4xxClientError());
} catch (Exception e) {
......@@ -231,7 +229,6 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
assertNull(projectDao.getProjectByProjectId("*"));
} finally {
removeUserInSeparateThread(curator);
Project project = projectDao.getProjectByProjectId("*");
if (project != null) {
projectDao.evict(project);
......@@ -278,7 +275,7 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
@Test
public void testUserPrivilegeChangeDuringUpload() throws Exception {
User admin = createAdminInSeparateThread(ADMIN_LOGIN, ADMIN_PASSWORD);
User admin = userDao.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
User curator = createAdminInSeparateThread(CURATOR_LOGIN, CURATOR_PASSWORD);
String TEST_PROJECT_2 = "test_id2";
......@@ -354,7 +351,6 @@ public class ProjectControllerIntegrationTestForAsyncCalls extends ControllerInt
throw e;
} finally {
removeUserInSeparateThread(curator);
removeUserInSeparateThread(admin);
removeProjectInSeparateThread(TEST_PROJECT_2);
removeProjectInSeparateThread(TEST_PROJECT);
}
......
......@@ -38,9 +38,6 @@ import lcsb.mapviewer.services.interfaces.IUserService;
@RunWith(SpringJUnit4ClassRunner.class)
public class ProjectControllerIntegrationTestWithoutTransaction extends ControllerIntegrationTest {
private static final String BUILT_IN_ADMIN_PASSWORD = "admin";
private static final String BUILT_IN_ADMIN_LOGIN = "admin";
Logger logger = LogManager.getLogger();
@Autowired
private IUserService userService;
......@@ -57,7 +54,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addProjectAsCurator() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
try {
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
......@@ -84,7 +81,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/{projectId}/", TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful())
.andDo(document("projects/project_data/create_simple",
......@@ -108,7 +105,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addComplexProjectAsCurator() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
try {
UploadedFileEntry fileEntry = createFileInSeparateThread(
Files.readAllBytes(Paths.get("./src/test/resources/complex_model_with_submaps.zip")), admin);
......@@ -155,7 +152,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/{projectId}/", TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful())
.andDo(document("projects/project_data/create_zip",
......@@ -256,7 +253,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addInvalidProject() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
admin);
......@@ -272,7 +269,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + invalidId)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
......@@ -283,7 +280,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addProjectWithTooLongName() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
admin);
......@@ -300,7 +297,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
......@@ -311,7 +308,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addProjectWithTooLongVersion() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
admin);
......@@ -328,7 +325,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
......@@ -349,7 +346,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = patch("/projects/" + TEST_PROJECT + "/")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(content)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
......@@ -369,7 +366,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
}
......@@ -377,7 +374,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void removeProjectWithUsedFile() throws Exception {
String testProject2 = "test2";
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
try {
UploadedFileEntry fileEntry = createFileInSeparateThread(
new String(Files.readAllBytes(Paths.get("./src/test/resources/generic.xml")), "UTF-8"),
......@@ -392,13 +389,13 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful());
request = post("/projects/" + testProject2)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful());
callInSeparateThread(() -> {
......@@ -411,7 +408,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
});
request = delete("/projects/{projectId}/", testProject2)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful())
.andDo(document("projects/project_data/delete",
......@@ -434,7 +431,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addComplexProjectWithInvalidOverlayName() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
Files.readAllBytes(Paths.get("./src/test/resources/complex_model_with_layouts.zip")), admin);
try {
......@@ -459,7 +456,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().isBadRequest());
} finally {
......@@ -469,7 +466,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addComplexProject() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
Files.readAllBytes(Paths.get("./src/test/resources/complex_model_with_layouts.zip")), admin);
try {
......@@ -494,7 +491,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful());
} finally {
......@@ -512,7 +509,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
@Test
public void addComplexProjectWithInvalidOverlay() throws Exception {
User admin = userService.getUserByLogin(BUILT_IN_ADMIN_LOGIN);
User admin = userService.getUserByLogin(BUILT_IN_TEST_ADMIN_LOGIN);
UploadedFileEntry fileEntry = createFileInSeparateThread(
Files.readAllBytes(Paths.get("./src/test/resources/complex_model_with_invalid_layouts.zip")), admin);
try {
......@@ -537,7 +534,7 @@ public class ProjectControllerIntegrationTestWithoutTransaction extends Controll
RequestBuilder request = post("/projects/" + TEST_PROJECT)
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.content(body)
.session(createSession(BUILT_IN_ADMIN_LOGIN, BUILT_IN_ADMIN_PASSWORD));
.session(createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD));
mockMvc.perform(request).andExpect(status().is2xxSuccessful());
callInSeparateThread(() -> {
......
......@@ -51,8 +51,7 @@ public class PublicationsControllerIntegrationTest extends ControllerIntegration
@Test
public void testGetPublicationsForMap() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
project = createProject(TEST_PROJECT);
map = project.getModels().iterator().next();
......@@ -91,8 +90,7 @@ public class PublicationsControllerIntegrationTest extends ControllerIntegration
@Test
public void testGetPublicationsWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/" + map.getId() + "/publications/")
.session(session);
......
......@@ -73,11 +73,10 @@ public class ReactionControllerIntegrationTest extends ControllerIntegrationTest
assertTrue("user should be able to access elements", reactions > 0);
}
@Test
public void testGetReactionsWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/models/*/bioEntities/reactions/")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
......
......@@ -49,8 +49,7 @@ public class UnitsControllerIntegrationTest extends ControllerIntegrationTest {
@Test
public void testGetUnitListWithUndefinedProject() throws Exception {
MockHttpSession session = createSession(ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_LOGIN,
ControllerIntegrationTest.BUILT_IN_TEST_ADMIN_PASSWORD);