Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
21014989
Commit
21014989
authored
Aug 22, 2019
by
Piotr Gawron
Browse files
searching drugs with undefined projectId returns NotFound status
parent
5f5a7fc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalRestImpl.java
View file @
21014989
...
...
@@ -46,7 +46,7 @@ public class ChemicalRestImpl extends BaseRestImpl {
throws
QueryException
{
Model
model
=
getModelService
().
getLastModelByProjectId
(
projectId
);
if
(
model
==
null
)
{
throw
new
Query
Exception
(
"Project with given id doesn't exist"
);
throw
new
ObjectNotFound
Exception
(
"Project with given id doesn't exist"
);
}
Project
project
=
getProjectService
().
getProjectByProjectId
(
projectId
);
if
(
project
.
getDisease
()
==
null
)
{
...
...
web/src/test/java/lcsb/mapviewer/web/ChemicalControllerIntegrationTest.java
View file @
21014989
...
...
@@ -50,6 +50,18 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
.
andExpect
(
status
().
is2xxSuccessful
());
}
@Test
public
void
testSearchChemicalsInAsteriskProjectId
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
TEST_ADMIN_LOGIN
,
TEST_ADMIN_PASSWORD
);
RequestBuilder
request
=
get
(
"/projects/*/chemicals:search?query=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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment