Integration tests for twofactor
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
a58debcb2e
commit
5dbde0f2ed
+1
-1
@@ -83,7 +83,7 @@ public class ExternalServicesPropertiesReadPlatformServiceImpl implements Extern
|
||||
|
||||
if (ExternalServicesConstants.SMTP_USERNAME.equalsIgnoreCase(name)) {
|
||||
username = value;
|
||||
} else if (ExternalServicesConstants.SMTP_PORT.equalsIgnoreCase(port)) {
|
||||
} else if (ExternalServicesConstants.SMTP_PORT.equalsIgnoreCase(name)) {
|
||||
port = value;
|
||||
} else if (ExternalServicesConstants.SMTP_PASSWORD.equalsIgnoreCase(name)) {
|
||||
password = value;
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -69,7 +70,7 @@ public final class DateUtils {
|
||||
|
||||
public static LocalDateTime getLocalDateTimeOfTenant() {
|
||||
final ZoneId zone = getDateTimeZoneOfTenant();
|
||||
LocalDateTime today = LocalDateTime.now(zone);
|
||||
LocalDateTime today = LocalDateTime.now(zone).truncatedTo(ChronoUnit.SECONDS);
|
||||
return today;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -128,6 +128,6 @@ public class TFAccessToken extends AbstractPersistableCustom {
|
||||
}
|
||||
|
||||
private boolean isDateInThePast(LocalDateTime dateTime) {
|
||||
return dateTime.isBefore(DateUtils.getLocalDateTimeOfTenant());
|
||||
return (dateTime.isBefore(DateUtils.getLocalDateTimeOfTenant()) || dateTime.isEqual(DateUtils.getLocalDateTimeOfTenant()));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -53,9 +53,9 @@ insert into c_external_service_properties (`name`, `value`, `external_service_id
|
||||
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('password', 'support80', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('host', 'smtp.gmail.com', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('host', 'localhost', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('port', '587', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('port', '3025', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
|
||||
insert into c_external_service_properties (`name`, `value`, `external_service_id`) values('useTLS', 'true', (select id from c_external_service where name = 'SMTP_Email_Account'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user