diff --git a/src/main/java/com/glencoesoftware/ldaptool/MockSimpleRoleProvider.java b/src/main/java/com/glencoesoftware/ldaptool/MockSimpleRoleProvider.java index b8d31f7..c113282 100644 --- a/src/main/java/com/glencoesoftware/ldaptool/MockSimpleRoleProvider.java +++ b/src/main/java/com/glencoesoftware/ldaptool/MockSimpleRoleProvider.java @@ -1,6 +1,7 @@ package com.glencoesoftware.ldaptool; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,6 +13,8 @@ public class MockSimpleRoleProvider extends SimpleRoleProvider { + private AtomicLong nextExperimenterGroupId = new AtomicLong(1L); + private static final Logger log = LoggerFactory.getLogger(MockSimpleRoleProvider.class); @@ -27,11 +30,12 @@ public MockSimpleRoleProvider(SecuritySystem sec, SessionFactory sf, @Override public long createGroup( String name, Permissions perms, boolean strict, boolean isLdap) { + long id = nextExperimenterGroupId.getAndIncrement(); log.info( - "Would have created ExperimenterGroup name={} perms={} strict={} " + - "isLdap={}", name, perms, strict, isLdap + "Would have created ExperimenterGroup id={} name={} perms={} " + + "strict={} isLdap={}", name, perms, strict, isLdap ); - return 1; + return id; } }