Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
4f852035
Commit
4f852035
authored
Jun 21, 2021
by
Piotr Gawron
Browse files
missing autowired field
parent
e470d392
Pipeline
#43394
passed with stage
in 19 minutes and 46 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
4f852035
...
...
@@ -26,6 +26,7 @@ minerva (16.0.0~beta.1) stable; urgency=medium
*
Bug
fix
:
top
map
was
not
selected
properly
sometimes
(#
1487
)
*
Bug
fix
:
data
overlays
in
comlex
upload
prevented
error
to
be
propagated
to
user
(#
1499
)
*
Bug
fix
:
searching
for
all
chemicals
by
target
did
not
work
(#
1490
)
--
Piotr
Gawron
<
piotr
.
gawron
@
uni
.
lu
>
Wed
,
9
Jun
2021
15
:
00
:
00
+
0200
...
...
rest-api/src/main/java/lcsb/mapviewer/api/projects/chemicals/ChemicalRestImpl.java
View file @
4f852035
...
...
@@ -35,15 +35,16 @@ public class ChemicalRestImpl extends BaseRestImpl {
private
Logger
logger
=
LogManager
.
getLogger
();
private
IChemicalService
chemicalService
;
private
IElementService
elementService
;
private
MeSHParser
meSHParser
;
@Autowired
public
ChemicalRestImpl
(
IChemicalService
chemicalService
,
MeSHParser
meSHParser
)
{
public
ChemicalRestImpl
(
IChemicalService
chemicalService
,
MeSHParser
meSHParser
,
IElementService
elementService
)
{
this
.
chemicalService
=
chemicalService
;
this
.
meSHParser
=
meSHParser
;
this
.
elementService
=
elementService
;
}
public
List
<
Map
<
String
,
Object
>>
getChemicalsByQuery
(
String
projectId
,
String
columns
,
String
query
)
...
...
web/src/test/java/lcsb/mapviewer/web/ChemicalControllerIntegrationTest.java
View file @
4f852035
...
...
@@ -25,6 +25,8 @@ import com.google.gson.JsonParser;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.map.MiriamData
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.species.Element
;
import
lcsb.mapviewer.model.map.species.SimpleMolecule
;
import
lcsb.mapviewer.services.interfaces.IProjectService
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
...
...
@@ -42,10 +44,12 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
@Autowired
private
IProjectService
projectService
;
private
Project
project
;
@Before
public
void
setup
()
{
assumeTrue
(
"DAPI credentials are not provided"
,
isDapiConfigurationAvailable
());
createProject
(
TEST_PROJECT
);
project
=
createProject
(
TEST_PROJECT
);
}
@After
...
...
@@ -159,6 +163,26 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
.
andExpect
(
status
().
isNotFound
());
}
@Test
public
void
testSearchChemicalsByTarget
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
BUILT_IN_TEST_ADMIN_LOGIN
,
BUILT_IN_TEST_ADMIN_PASSWORD
);
Element
element
=
null
;
for
(
Element
e
:
project
.
getTopModel
().
getElements
())
{
if
(
e
instanceof
SimpleMolecule
)
{
element
=
e
;
}
}
RequestBuilder
request
=
get
(
"/projects/{projectId}/chemicals:search?target=ALIAS:{aliasId}"
,
TEST_PROJECT
,
element
.
getId
())
.
session
(
session
);
mockMvc
.
perform
(
request
)
.
andExpect
(
status
().
is2xxSuccessful
());
}
@Test
public
void
testgGetSuggestedList
()
throws
Exception
{
MockHttpSession
session
=
createSession
(
BUILT_IN_TEST_ADMIN_LOGIN
,
BUILT_IN_TEST_ADMIN_PASSWORD
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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