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

unused test function removed

parent 9a91f723
No related branches found
No related tags found
1 merge request!782Resolve "Replace deprecated APIs"
......@@ -71,35 +71,6 @@ public class DbUtils extends Observable {
this.sessionFactory = sessionFactory;
}
/**
* Executes sql query given in the parameter.
*
* @param query
* sql query to be executed
* @return The number of entities updated or deleted.
*/
public int executeSqlQuery(String query) {
return executeSqlQuery(query, new HashMap<String, Object>());
}
/**
* Executes sql query given in the parameter.
*
* @param query
* sql query to be executed
* @param params
* map of parameters used in the query
* @return The number of entities updated or deleted.
*/
public int executeSqlQuery(String query, Map<String, Object> params) {
SQLQuery sqlQuery = getSessionFactory().getCurrentSession().createSQLQuery(query);
for (Entry<String, Object> entry : params.entrySet()) {
sqlQuery.setParameter(entry.getKey(), entry.getValue());
}
return sqlQuery.executeUpdate();
}
/**
* Returns hibernate session for current thread.
*
......
......@@ -6,10 +6,9 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
......@@ -38,19 +37,13 @@ public class UserDaoTest extends PersistTestFunctions {
protected PasswordEncoder passwordEncoder;
protected Logger logger = LogManager.getLogger(UserDaoTest.class.getName());
String testLogin = "test_login123";
String testEmail = "a@a.pl";
String testPasswd = "pwd";
String testLogin2 = "test_login_tmp";
String testName = "John";
String testSurname = "Doe";
private String testLogin = "test_login123";
private String testEmail = "a@a.pl";
private String testPasswd = "pwd";
private String testLogin2 = "test_login_tmp";
@Before
public void setUp() throws Exception {
Map<String, Object> params = new HashMap<String, Object>();
params.put("login_param", testLogin);
params.put("login_param2", testLogin2);
dbUtils.executeSqlQuery("delete from user_table where login = :login_param or login = :login_param2", params);
}
@After
......@@ -275,7 +268,7 @@ public class UserDaoTest extends PersistTestFunctions {
UserAnnotationSchema uas = new UserAnnotationSchema();
user.setAnnotationSchema(uas);
UserClassAnnotators classAnnotators = new UserClassAnnotators(Integer.class);
AnnotatorData annotatorData =new AnnotatorData(String.class);
AnnotatorData annotatorData = new AnnotatorData(String.class);
classAnnotators.addAnnotator(annotatorData);
uas.addClassAnnotator(classAnnotators);
AnnotatorConfigParameter param = new AnnotatorConfigParameter(AnnotatorParamDefinition.KEGG_ORGANISM_IDENTIFIER,
......
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