Commit 028f046e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

problem with transaction when obtaining list of elements inside overlay

parent 4d44bef3
......@@ -15,6 +15,7 @@ import org.junit.runners.Suite.SuiteClasses;
MapControllerIntegrationTest.class,
MiRnaControllerIntegrationTest.class,
OverlayControllerIntegrationTest.class,
OverlayControllerIntegrationTestWithoutTransaction.class,
PluginControllerIntegrationTest.class,
ProjectControllerIntegrationTest.class,
ProjectControllerIntegrationTestForAsyncCalls.class,
......
package lcsb.mapviewer.web;
import static org.junit.Assert.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import java.util.Arrays;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
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 com.google.gson.JsonParser;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.model.map.layout.Layout;
import lcsb.mapviewer.model.map.model.ModelData;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.security.PrivilegeType;
import lcsb.mapviewer.model.user.ConfigurationElementType;
import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.persist.dao.map.LayoutDao;
import lcsb.mapviewer.services.interfaces.*;
@RunWith(SpringJUnit4ClassRunner.class)
@Rollback
public class OverlayControllerIntegrationTestWithoutTransaction extends ControllerIntegrationTest {
Logger logger = LogManager.getLogger();
private static final String BUILD_IN_TEST_ADMIN_PASSWORD = "admin";
private static final String BUILD_IN_TEST_ADMIN_LOGIN = "admin";
private String defaultProjectId;
@Autowired
IConfigurationService configurationService;
@Before
public void setup() throws Exception {
defaultProjectId = configurationService.getConfigurationValue(ConfigurationElementType.DEFAULT_MAP);
}
@Test
public void testGetBioEntitiesForNonExistingOverlay() throws Exception {
RequestBuilder request = get(
"/projects/" + defaultProjectId + "/overlays/-1/models/*/bioEntities/")
.contentType(MediaType.APPLICATION_FORM_URLENCODED);
mockMvc.perform(request)
.andExpect(status().is4xxClientError());
}
}
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