public GroupEntity createGroupInUserstore( String name, GroupType groupType, String userstoreName) { GroupEntity group = new GroupEntity(); group.setKey(new GroupKey(Integer.toString(mockKeyService.generateNextKeySafe("TGROUP")))); group.setName(name); group.setSyncValue("sync_" + name); group.setDeleted(0); group.setRestricted(1); group.setType(groupType); group.setUserStore(fixture.findUserStoreByName(userstoreName)); return group; }
public UserEntity createUser( String uid, String displayName, UserType type, String userStoreName, GroupEntity group) { UserEntity user = new UserEntity(); user.setName(uid); user.setDisplayName(displayName); user.setSyncValue(uid); user.setTimestamp(new DateTime()); user.setType(type); user.setDeleted(0); if (userStoreName != null) { user.setUserStore(fixture.findUserStoreByName(userStoreName)); } if (group != null) { user.setUserGroup(group); } return user; }
public UserEntity createUserWithAllValues( String uid, String displayName, UserType type, String userStoreName, UserInfo userInfo) { UserEntity user = new UserEntity(); user.setName(uid); user.setDisplayName(displayName); user.setSyncValue(uid); user.setTimestamp(new DateTime()); user.setType(type); user.setDeleted(0); if (userStoreName != null) { user.setUserStore(fixture.findUserStoreByName(userStoreName)); } user.setUserGroup(null); user.setUserFields(new UserInfoTransformer().toUserFields(userInfo)); return user; }