Commit 9c5343a4 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

searching drugs by target with undefined projectId returns NotFound status

parent 21014989
......@@ -155,7 +155,7 @@ public class ChemicalRestImpl extends BaseRestImpl {
String targetId, String columns) throws QueryException {
Model model = getModelService().getLastModelByProjectId(projectId);
if (model == null) {
throw new QueryException("Project with given id doesn't exist");
throw new ObjectNotFoundException("Project with given id doesn't exist");
}
Project project = getProjectService().getProjectByProjectId(projectId);
......
......@@ -62,6 +62,18 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
.andExpect(status().isNotFound());
}
@Test
public void testSearchChemicalsByTargetInAsteriskProjectId() throws Exception {
MockHttpSession session = createSession(TEST_ADMIN_LOGIN, TEST_ADMIN_PASSWORD);
RequestBuilder request = get("/projects/*/chemicals:search?target=ALIAS:xyz")
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
.session(session);
mockMvc.perform(request)
.andExpect(status().isNotFound());
}
@Test
public void testgGetSuggestedList() throws Exception {
MockHttpSession session = createSession(TEST_ADMIN_LOGIN, TEST_ADMIN_PASSWORD);
......
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