Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

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

update unit tests

parent 63b2c543
No related branches found
No related tags found
No related merge requests found
......@@ -216,7 +216,9 @@ public class TestUtilsDao {
DBCredential c1 = TestDBUtils.createDBCredentialForUser(user1, null, null, null);
c1.setValue(BCrypt.hashpw(USERNAME_1_PASSWORD, BCrypt.gensalt()));
user1.getUserCredentials().add(c1);
user2 = createDBUserByCertificate(USER_CERT_2);
user3 = createDBUserByUsername(USERNAME_3);
DBCredential c3 = TestDBUtils.createDBCredentialForUserAccessToken(user3, null, null, null);
c3.setValue(BCrypt.hashpw(USERNAME_3_AT_PASSWORD, BCrypt.gensalt()));
......
......@@ -59,7 +59,7 @@ public abstract class AbstractServiceIntegrationTest extends AbstractBaseDao {
protected Path resourceDirectory = Paths.get("src", "test", "resources", "keystores");
protected Path targetDirectory = Paths.get("target", "keystores");
protected Path targetDirectory = Paths.get("target", "smp");
@Autowired
protected ResourceDao serviceGroupDao;
......@@ -245,4 +245,5 @@ public abstract class AbstractServiceIntegrationTest extends AbstractBaseDao {
FileUtils.deleteDirectory(targetDirectory.toFile());
FileUtils.copyDirectory(resourceDirectory.toFile(), targetDirectory.toFile());
}
}
......@@ -102,7 +102,6 @@ public class CredentialServiceTest extends AbstractServiceIntegrationTest {
credential.setLastFailedLoginAttempt(OffsetDateTime.now());
credential.setSequentialLoginFailureCount(100);
testUtilsDao.merge(credential);
testUtilsDao.clear();
// given
String username = TestConstants.USERNAME_1;
......@@ -118,7 +117,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;
......
......@@ -262,7 +262,6 @@ public class TestDBUtils {
public static DBUser createDBUserByUsername(String userName) {
DBUser dbuser = new DBUser();
dbuser.setUsername(userName);
dbuser.setEmailAddress(userName + "@test.eu");
dbuser.setActive(true);
......
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