Skip to content

Commit 35b1b9a

Browse files
committed
WIP for #561
1 parent 638e0dc commit 35b1b9a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

server/src/main/java/invite/cron/RoleExpirationNotifier.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public List<String> doSweep() {
5757
return userRoles.stream().map(userRole -> {
5858
List<GroupedProviders> groupedProviders = manage.getGroupedProviders(List.of(userRole.getRole()));
5959
GroupedProviders groupedProvider = groupedProviders.isEmpty() ? null : groupedProviders.get(0);
60+
Instant endDate = userRole.getEndDate();
61+
long daysBetween = ChronoUnit.DAYS.between(endDate, instant);
6062
String mail = mailBox.sendUserRoleExpirationNotificationMail(userRole, groupedProvider, roleExpirationNotificationDays);
6163
//https://stackoverflow.com/a/75121707
6264
userRoleRepository.updateExpiryNotifications(1, userRole.getId());

server/src/test/java/invite/cron/RoleExpirationNotifierTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void sweep() {
3232

3333
MimeMessageParser messageParser = super.mailMessage();
3434
String htmlContent = messageParser.getHtmlContent();
35-
//Due to html formatting we can't be sure of the line breaks
35+
//Due to HTML formatting, we can't be sure of the line breaks
3636
Stream.of("Your Inviter role Mail at the application Calendar EN will expire in 5 days".split(" "))
3737
.forEach(s -> assertTrue(htmlContent.contains(s)));
3838

0 commit comments

Comments
 (0)