From fe999b9b25fef57792d40e1d4722e262c27a3a2a Mon Sep 17 00:00:00 2001 From: Patrick Hobusch Date: Thu, 16 May 2024 20:52:05 +0800 Subject: [PATCH] Applications: Order list of directory mappings by directory name --- .../aservo/confapi/crowd/model/util/ApplicationBeanUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/aservo/confapi/crowd/model/util/ApplicationBeanUtil.java b/src/main/java/de/aservo/confapi/crowd/model/util/ApplicationBeanUtil.java index 76f5e8c..a8f4f51 100644 --- a/src/main/java/de/aservo/confapi/crowd/model/util/ApplicationBeanUtil.java +++ b/src/main/java/de/aservo/confapi/crowd/model/util/ApplicationBeanUtil.java @@ -27,7 +27,9 @@ public static ApplicationBean toApplicationBean( applicationBean.setActive(application.isActive()); applicationBean.setType(toApplicationBeanType(application.getType())); applicationBean.setCachedDirectoriesAuthenticationOrderOptimisationEnabled(application.isCachedDirectoriesAuthenticationOrderOptimisationEnabled()); - applicationBean.setDirectoryMappings(toApplicationBeanDirectoryMappings(application, defaultGroupMembershipService)); + applicationBean.setDirectoryMappings(toApplicationBeanDirectoryMappings(application, defaultGroupMembershipService).stream() + .sorted(Comparator.comparing(ApplicationBean.ApplicationDirectoryMapping::getDirectoryName)) + .collect(Collectors.toList())); applicationBean.setAccessBasedSynchronisation(toApplicationBeanAccessBasedSynchronisation(application)); applicationBean.setMembershipAggregationEnabled(application.isMembershipAggregationEnabled()); applicationBean.setRemoteAddresses(toStringCollection(application.getRemoteAddresses()));