Skip to content
Snippets Groups Projects
Commit 575ceaec authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unit test fixed after refactor

parent 7ce00c0a
No related branches found
No related tags found
1 merge request!216Resolve "repositioning data overlays"
Pipeline #
......@@ -98,18 +98,6 @@ public class SearchService implements ISearchService {
@Autowired
private ISearchHistoryService searchHistoryService;
/**
* Factory object used to create {@link FullAliasView} objects.
*/
@Autowired
private FullAliasViewFactory fullAliasViewFactory;
/**
* Factory object used to create {@link FullReactionView} objects.
*/
@Autowired
private FullReactionViewFactory fullReactionViewFactory;
/**
* Object used for indexing elements on the map.
*/
......
......@@ -47,7 +47,7 @@ public class LightAliasView extends ElementView implements ILightView {
}
/**
* Constructory copying data from the original object.
* Constructor copying data from the original object.
*
* @param original
* original object from which data will be copied
......
......@@ -22,6 +22,7 @@ import lcsb.mapviewer.model.map.BioEntity;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamRelationType;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.layout.Layout;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
......@@ -43,8 +44,6 @@ import lcsb.mapviewer.model.map.species.Species;
import lcsb.mapviewer.model.map.species.Unknown;
import lcsb.mapviewer.services.ServiceTestFunctions;
import lcsb.mapviewer.services.interfaces.ISearchService.CoordinatesSearchParams;
import lcsb.mapviewer.services.search.data.FullAliasView;
import lcsb.mapviewer.services.search.data.FullReactionView;
import lcsb.mapviewer.services.search.data.SearchElementResult;
import lcsb.mapviewer.services.utils.SearchIndexer;
......@@ -94,8 +93,8 @@ public class SearchServiceTest extends ServiceTestFunctions {
assertNotNull(result);
assertEquals(4, result.getElements().size());
FullReactionView reaction = (FullReactionView) result.getElements().get(0);
assertTrue(reaction.getName().contains("re21"));
Reaction reaction = (Reaction) result.getElements().get(0);
assertTrue(reaction.getIdReaction().contains("re21"));
long count2 = searchHistoryDao.getCount();
......@@ -115,7 +114,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
assertNotNull(result);
assertTrue(result.getElements().size() > 0);
FullAliasView alias = (FullAliasView) result.getElements().get(0);
Species alias = (Species) result.getElements().get(0);
assertEquals("BAD:BCL-2", alias.getName());
} catch (Exception e) {
......@@ -170,7 +169,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
result = searchService.searchByQuery(model, "BAD:BCL-2", 50, true, "127.0.0.1");
assertNotNull(result);
assertEquals(1, result.size());
FullAliasView alias = (FullAliasView) result.get(0);
Species alias = (Species) result.get(0);
assertEquals("BAD:BCL-2", alias.getName());
} catch (Exception e) {
......@@ -189,7 +188,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
assertNotNull(result);
assertEquals(4, result.size());
Reaction reaction = (Reaction) result.get(0);
assertEquals("re21",reaction.getIdReaction());
assertEquals("re21", reaction.getIdReaction());
assertTrue(result.get(1) instanceof Species);
assertTrue(result.get(2) instanceof Species);
assertTrue(result.get(3) instanceof Species);
......@@ -229,9 +228,8 @@ public class SearchServiceTest extends ServiceTestFunctions {
assertNotNull(result);
assertTrue(result.size() > 0);
FullReactionView resultReaction = (FullReactionView) result.get(0);
logger.debug(resultReaction.getName());
assertTrue(resultReaction.getName().contains("test-name"));
Reaction resultReaction = (Reaction) result.get(0);
assertTrue(resultReaction.getIdReaction().contains("test-name"));
} catch (Exception e) {
e.printStackTrace();
throw e;
......@@ -247,7 +245,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
indexer.getQueryStringForIndex("BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
assertNotNull(result);
assertTrue(result.size() > 0);
FullAliasView alias = (FullAliasView) result.get(0);
Species alias = (Species) result.get(0);
assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
} catch (Exception e) {
e.printStackTrace();
......@@ -277,7 +275,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
indexer.getQueryStringForIndex("protein:BCL-2", speciesSearchReversePrefix.keySet()), 50, null, "127.0.0.1");
assertNotNull(result);
assertTrue(result.size() > 0);
FullAliasView alias = (FullAliasView) result.get(0);
Species alias = (Species) result.get(0);
assertTrue("Invalid alias: " + alias.getName(), alias.getName().toUpperCase().contains("BCL"));
} catch (Exception e) {
e.printStackTrace();
......@@ -494,9 +492,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
.searchByCoordinates(new CoordinatesSearchParams().model(model).x(50).y(50).layoutIdentifier(0));
assertNotNull(res);
assertTrue(res.get(0) instanceof FullAliasView);
FullAliasView view = (FullAliasView) res.get(0);
assertEquals("Compartment", view.getType());
assertTrue(res.get(0) instanceof Compartment);
} catch (Exception e) {
e.printStackTrace();
......@@ -518,7 +514,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
res = searchService.searchByCoordinates(new CoordinatesSearchParams().model(model).distance(1000));
assertEquals(3, res.size());
assertTrue(res.get(0) instanceof FullReactionView);
assertTrue(res.get(0) instanceof Reaction);
} catch (Exception e) {
e.printStackTrace();
......@@ -537,7 +533,7 @@ public class SearchServiceTest extends ServiceTestFunctions {
assertNotNull(res);
assertTrue(res.size() > 0);
assertTrue(res.get(0) instanceof FullAliasView);
assertTrue(res.get(0) instanceof Species);
} catch (Exception e) {
e.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment