Skip to content

Commit

Permalink
Update aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
g-duval committed Nov 28, 2024
1 parent 55e2d43 commit 3daa786
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void process(final Exchange exchange) throws JsonProcessingException {

exchange.setProperty(ExchangeProperty.RESOLVED_RECIPIENT_LIST, recipientsList.stream()
.map(DrawerUser::getUsername)
.filter(userName -> userName != null && !userName.trim().isEmpty())
.filter(userName -> userName != null && !userName.isBlank())
.collect(Collectors.toSet()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RecipientsResolverResponseProcessor implements Processor {
public void process(final Exchange exchange) throws JsonProcessingException {
final String body = exchange.getMessage().getBody(String.class);
final Set<String> recipientsList = Arrays.asList(this.objectMapper.readValue(body, User[].class))
.stream().map(User::getEmail).filter(email -> email != null && !email.trim().isEmpty()).collect(toSet());
.stream().map(User::getEmail).filter(email -> email != null && !email.isBlank()).collect(toSet());

Set<String> emails = exchange.getProperty(ExchangeProperty.EMAIL_RECIPIENTS, Set.class);
if (emailConnectorConfig.isEmailsInternalOnlyEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void aggregationBasedOnEmailAggregation(EmailAggregationKey aggregationK
unsubscribers,
eventType.isSubscribedByDefault(),
externalAuthorizationCriteria
);
).stream().filter(user -> user.getEmail() != null && !user.getEmail().isBlank()).collect(toSet());

/*
* We now have the final recipients list.
Expand Down Expand Up @@ -224,7 +224,7 @@ private void aggregationBasedOnEvent(EventAggregationCriteria eventAggregationCr
unsubscribers,
eventType.isSubscribedByDefault(),
externalAuthorizationCriterion
);
).stream().filter(user -> user.getEmail() != null && !user.getEmail().isBlank()).collect(toSet());

/*
* We now have the final recipients list.
Expand Down

0 comments on commit 3daa786

Please sign in to comment.