Commit 24833bdf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unit tests fixed

parent c59c9e18
package lcsb.mapviewer.annotation.services;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.when;
import java.util.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -17,15 +25,24 @@ import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
import lcsb.mapviewer.annotation.cache.SourceNotAvailable;
import lcsb.mapviewer.annotation.data.MiRNA;
import lcsb.mapviewer.annotation.data.Target;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.persist.dao.ProjectDao;
import lcsb.mapviewer.persist.dao.user.UserDao;
public class MiRNAParserTest extends AnnotationTestFunctions {
Logger logger = LogManager.getLogger();
@Autowired
protected ProjectDao projectDao;
@Autowired
protected UserDao userDao;
@Autowired
private MiRNAParser miRNAParser;
......@@ -195,8 +212,9 @@ public class MiRNAParserTest extends AnnotationTestFunctions {
@Test
public void testGetEmptySuggestedQueryList() throws Exception {
Project project = new Project();
project.setId(-1);
Project project = new Project("test_1");
project.setOwner(userDao.getUserByLogin(Configuration.ANONYMOUS_LOGIN));
projectDao.add(project);
List<String> result = miRNAParser.getSuggestedQueryList(project);
......@@ -205,10 +223,11 @@ public class MiRNAParserTest extends AnnotationTestFunctions {
@Test
public void testGetSuggestedQueryList() throws Exception {
Project project = new Project();
project.setId(-2);
Project project = new Project("test_1");
project.setOwner(userDao.getUserByLogin(Configuration.ANONYMOUS_LOGIN));
Model model = getModelForFile("testFiles/target_mirna/target.xml", false);
project.addModel(model);
projectDao.add(project);
List<String> result = miRNAParser.getSuggestedQueryList(project);
......
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