Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 63b2c543 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

update unit tests

parent a85ac131
No related branches found
No related tags found
No related merge requests found
......@@ -595,6 +595,12 @@ public class TestUtilsDao {
return memEManager.merge(entity);
}
public void clear() {
memEManager.clear();
}
public DBDomain getD1() {
return d1;
}
......
......@@ -14,6 +14,7 @@ import org.springframework.security.core.Authentication;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import java.time.OffsetDateTime;
import static org.junit.Assert.*;
......@@ -27,9 +28,10 @@ public class CredentialServiceTest extends AbstractServiceIntegrationTest {
CredentialService testInstance;
@Before
public void beforeMethods() {
public void beforeMethods() throws IOException {
testUtilsDao.clearData();
testUtilsDao.createUsers();
resetKeystore();
configurationDao.refreshProperties();
}
......@@ -100,6 +102,7 @@ public class CredentialServiceTest extends AbstractServiceIntegrationTest {
credential.setLastFailedLoginAttempt(OffsetDateTime.now());
credential.setSequentialLoginFailureCount(100);
testUtilsDao.merge(credential);
testUtilsDao.clear();
// given
String username = TestConstants.USERNAME_1;
......@@ -115,6 +118,7 @@ public class CredentialServiceTest extends AbstractServiceIntegrationTest {
credential.setLastFailedLoginAttempt(OffsetDateTime.now().minusDays(100));
credential.setSequentialLoginFailureCount(100);
testUtilsDao.merge(credential);
testUtilsDao.clear();
// given
String username = TestConstants.USERNAME_1;
......
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