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

test checking search mirna

parent e285419e
......@@ -10,6 +10,7 @@ import org.junit.runners.Suite.SuiteClasses;
DrugControllerIntegrationTest.class,
FileControllerIntegrationTest.class,
MapControllerIntegrationTest.class,
MiRnaControllerIntegrationTest.class,
OverlayControllerIntegrationTest.class,
PluginControllerIntegrationTest.class,
ProjectControllerIntegrationTest.class,
......
......@@ -41,7 +41,7 @@ public class DrugControllerIntegrationTest extends ControllerIntegrationTest {
}
@Test
public void grantPrivilegeForAnonymousUser() throws Exception {
public void testSearchDrugsInProjectUrl() throws Exception {
MockHttpSession session = createSession(TEST_ADMIN_LOGIN, TEST_ADMIN_PASSWORD);
RequestBuilder request = patch("/projects/" + project_id + "/drugs:search")
......
package lcsb.mapviewer.web;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.RequestBuilder;
import org.springframework.transaction.annotation.Transactional;
import lcsb.mapviewer.model.user.ConfigurationElementType;
import lcsb.mapviewer.services.interfaces.IConfigurationService;
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
@Rollback
public class MiRnaControllerIntegrationTest extends ControllerIntegrationTest {
Logger logger = LogManager.getLogger();
private static final String TEST_ADMIN_PASSWORD = "test_admin";
private static final String TEST_ADMIN_LOGIN = "test_admin";
@Autowired
IConfigurationService configurationService;
String project_id;
@Before
public void setup() {
createAdmin(TEST_ADMIN_LOGIN, TEST_ADMIN_PASSWORD);
project_id = configurationService.getConfigurationValue(ConfigurationElementType.DEFAULT_MAP);
}
@Test
public void testSearchMiRnasInProjectUrl() throws Exception {
MockHttpSession session = createSession(TEST_ADMIN_LOGIN, TEST_ADMIN_PASSWORD);
RequestBuilder request = patch("/projects/" + project_id + "/miRnas:search")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.session(session);
mockMvc.perform(request)
.andExpect(status().is2xxSuccessful());
}
}
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