|
|
@ -30,6 +30,7 @@ public class LdapSyncTest { |
|
|
|
remoteEntries.add(searchResultEntry("dn=fDai1235,dc=remote,dc=de", "FDai1235", "Schuster", "Schuster")); |
|
|
|
remoteEntries.add(searchResultEntry("dn=fdaI1236,dc=remote,dc=de", "fdAI1236", "Bunsen", "Bunsen")); |
|
|
|
remoteEntries.add(searchResultEntry("dn=fDeT123,dc=remote,dc=de", "FDET123", "Bauer", "Bauer")); |
|
|
|
remoteEntries.add(searchResultEntry("dn=fdw9424,dc=remote,dc=de", "fdw9424", "Hein", "Bloed")); |
|
|
|
remoteEntries.add(searchResultEntry("dn=fdXx9999,dc=remote,dc=de", "fdxX9999", "Schmidt", "Schmidt")); |
|
|
|
final AccountSource remote = new AccountSource("dc=remote,dc=de", remoteEntries); |
|
|
|
|
|
|
@ -55,7 +56,7 @@ public class LdapSyncTest { |
|
|
|
assertTrue(delSet.contains("fdai1237")); |
|
|
|
assertTrue(delSet.contains("fdai1238")); |
|
|
|
|
|
|
|
assertEquals(addList.size(), 4); |
|
|
|
assertEquals(5, addList.size()); |
|
|
|
|
|
|
|
for (final Entry entry : addList) { |
|
|
|
assertTrue(entry.getDN().endsWith(",dc=local,dc=de")); |
|
|
@ -96,6 +97,8 @@ public class LdapSyncTest { |
|
|
|
assertEquals(10149999, (int) LdapSync.computeUid("fdaa9999")); |
|
|
|
assertEquals(262641000, (int) LdapSync.computeUid("fdzz1000")); |
|
|
|
assertEquals(262649999, (int) LdapSync.computeUid("fdzz9999")); |
|
|
|
assertEquals(270000001, (int) LdapSync.computeUid("fd0000001")); |
|
|
|
assertEquals(279999999, (int) LdapSync.computeUid("fd9999999")); |
|
|
|
|
|
|
|
// test user defined mappings |
|
|
|
Map<String, Integer> mappings; |
|
|
@ -114,12 +117,17 @@ public class LdapSyncTest { |
|
|
|
|
|
|
|
mappings = LdapSync.parseUserDefinedMappings("fdg00244:300000244"); |
|
|
|
assertEquals(300000244, (int) LdapSync.computeUid("fdg00244", mappings)); |
|
|
|
assertEquals(41000, (int) LdapSync.computeUid("fd1000", mappings)); |
|
|
|
assertEquals(49999, (int) LdapSync.computeUid("fd9999", mappings)); |
|
|
|
assertEquals(10141000, (int) LdapSync.computeUid("fdaa1000", mappings)); |
|
|
|
assertEquals(10149999, (int) LdapSync.computeUid("fdaa9999", mappings)); |
|
|
|
assertEquals( 41000, (int) LdapSync.computeUid("fd1000", mappings)); |
|
|
|
assertEquals( 49999, (int) LdapSync.computeUid("fd9999", mappings)); |
|
|
|
assertEquals( 10141000, (int) LdapSync.computeUid("fdaa1000", mappings)); |
|
|
|
assertEquals(262641000, (int) LdapSync.computeUid("fdzz1000", mappings)); |
|
|
|
assertEquals( 10041000, (int) LdapSync.computeUid("fda1000", mappings)); |
|
|
|
assertEquals(260041000, (int) LdapSync.computeUid("fdz1000", mappings)); |
|
|
|
assertEquals( 10149999, (int) LdapSync.computeUid("fdaa9999", mappings)); |
|
|
|
assertEquals(262649999, (int) LdapSync.computeUid("fdzz9999", mappings)); |
|
|
|
assertEquals(300000000, (int) LdapSync.computeUid("fdg00000", mappings)); |
|
|
|
assertEquals(300099999, (int) LdapSync.computeUid("fdg99999", mappings)); |
|
|
|
assertEquals(230049123, (int) LdapSync.computeUid("fdw9123", mappings)); |
|
|
|
|
|
|
|
mappings = LdapSync.parseUserDefinedMappings("aaabbb"); |
|
|
|
assertEquals(0, mappings.size()); |
|
|
|