You can clone with HTTPS or SSH.
@Inject private IdentitySession identitySession; @Inject private Identity identity; @Inject private UserTransaction tx; @Before public void setupTestUser() throws IdentityException, FeatureNotSupportedException, SystemException, NotSupportedException, RollbackException, HeuristicRollbackException, HeuristicMixedException { final PersistenceManager pm = identitySession.getPersistenceManager(); final AttributesManager am = identitySession.getAttributesManager(); final RelationshipManager rm = identitySession.getRelationshipManager(); // Group creation must be done in a separate transaction so it's flushed to the DB before adding members to that group tx.begin(); // Setup the group we want our user to belong to final Group memberGroup = pm.createGroup("member", "USER"); final User user = pm.createUser("test"); am.updatePassword(user, "password"); tx.commit(); // Now we can go ahead and create the association tx.begin(); rm.associateUser(memberGroup, user); tx.commit(); } @Test public void assertUserCanAuthenticate(Credentials credentials) { credentials.setUsername("test"); credentials.setCredential(new PasswordCredential("password")); assertThat(identity.login(), is(Identity.RESPONSE_LOGIN_SUCCESS)); }