user.setName("Test Name");
user.setEmailAddress("test@test.com");
user.setExternalIdBundle(BUNDLE);
user.setEntitlements(Sets.newHashSet("A", "B"));
ZoneId zone = user.getTimeZone();
UserDocument doc = new UserDocument(user);
UserDocument test = _usrMaster.add(doc);
UniqueId uniqueId = test.getUniqueId();
assertNotNull(uniqueId);
assertEquals("DbUsr", uniqueId.getScheme());
assertTrue(uniqueId.isVersioned());
assertTrue(Long.parseLong(uniqueId.getValue()) >= 1000);
assertEquals("0", uniqueId.getVersion());
assertEquals(now, test.getVersionFromInstant());
assertEquals(null, test.getVersionToInstant());
assertEquals(now, test.getCorrectionFromInstant());
assertEquals(null, test.getCorrectionToInstant());
ManageableOGUser testUser = test.getUser();
assertNotNull(testUser);
assertEquals(uniqueId, testUser.getUniqueId());
assertEquals("TESTHASH", testUser.getPasswordHash());
assertEquals("Test Name", testUser.getName());
assertEquals(zone, testUser.getTimeZone());