Commit 4f852035 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

missing autowired field

parent e470d392
Pipeline #43394 passed with stage
in 19 minutes and 46 seconds
...@@ -26,6 +26,7 @@ minerva (16.0.0~beta.1) stable; urgency=medium ...@@ -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: top map was not selected properly sometimes (#1487)
* Bug fix: data overlays in comlex upload prevented error to be propagated * Bug fix: data overlays in comlex upload prevented error to be propagated
to user (#1499) 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 -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 9 Jun 2021 15:00:00 +0200
......
...@@ -35,15 +35,16 @@ public class ChemicalRestImpl extends BaseRestImpl { ...@@ -35,15 +35,16 @@ public class ChemicalRestImpl extends BaseRestImpl {
private Logger logger = LogManager.getLogger(); private Logger logger = LogManager.getLogger();
private IChemicalService chemicalService; private IChemicalService chemicalService;
private IElementService elementService; private IElementService elementService;
private MeSHParser meSHParser; private MeSHParser meSHParser;
@Autowired @Autowired
public ChemicalRestImpl(IChemicalService chemicalService, MeSHParser meSHParser) { public ChemicalRestImpl(IChemicalService chemicalService, MeSHParser meSHParser, IElementService elementService) {
this.chemicalService = chemicalService; this.chemicalService = chemicalService;
this.meSHParser = meSHParser; this.meSHParser = meSHParser;
this.elementService = elementService;
} }
public List<Map<String, Object>> getChemicalsByQuery(String projectId, String columns, String query) public List<Map<String, Object>> getChemicalsByQuery(String projectId, String columns, String query)
......
...@@ -25,6 +25,8 @@ import com.google.gson.JsonParser; ...@@ -25,6 +25,8 @@ import com.google.gson.JsonParser;
import lcsb.mapviewer.model.Project; import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.MiriamData; import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType; 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; import lcsb.mapviewer.services.interfaces.IProjectService;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
...@@ -42,10 +44,12 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest ...@@ -42,10 +44,12 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
@Autowired @Autowired
private IProjectService projectService; private IProjectService projectService;
private Project project;
@Before @Before
public void setup() { public void setup() {
assumeTrue("DAPI credentials are not provided", isDapiConfigurationAvailable()); assumeTrue("DAPI credentials are not provided", isDapiConfigurationAvailable());
createProject(TEST_PROJECT); project = createProject(TEST_PROJECT);
} }
@After @After
...@@ -159,6 +163,26 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest ...@@ -159,6 +163,26 @@ public class ChemicalControllerIntegrationTest extends ControllerIntegrationTest
.andExpect(status().isNotFound()); .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 @Test
public void testgGetSuggestedList() throws Exception { public void testgGetSuggestedList() throws Exception {
MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_TEST_ADMIN_PASSWORD); MockHttpSession session = createSession(BUILT_IN_TEST_ADMIN_LOGIN, BUILT_IN_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