@After
 public void cleanupDataSource() throws Exception {
   IdentityZoneHolder.clear();
   TestUtils.deleteFrom(dataSource, "group_membership");
   TestUtils.deleteFrom(dataSource, "groups");
   TestUtils.deleteFrom(dataSource, "users");
   validateCount(0);
 }
 @AfterClass
 public static void tearDown() throws Exception {
   TestUtils.deleteFrom(database, "users", "groups", "group_membership");
   if (database != null) {
     database.shutdown();
   }
 }
 private void addUser(
     String id,
     String username,
     String password,
     String email,
     String givenName,
     String familyName,
     String phoneNumber) {
   TestUtils.assertNoSuchUser(template, "id", id);
   template.execute(
       String.format(
           addUserSqlFormat, id, username, password, email, givenName, familyName, phoneNumber));
 }
Exemplo n.º 4
0
 private void addUser(
     String id,
     String username,
     String password,
     String email,
     String givenName,
     String familyName,
     String phoneNumber,
     String identityProviderId,
     String identityZoneId) {
   TestUtils.assertNoSuchUser(jdbcTemplate, "id", id);
   jdbcTemplate.execute(
       String.format(
           ADD_USER_SQL_FORMAT,
           id,
           username,
           password,
           email,
           givenName,
           familyName,
           phoneNumber,
           identityZoneId));
 }
Exemplo n.º 5
0
  @Before
  public void initScimGroupBootstrapTests() {
    JdbcTemplate template = jdbcTemplate;
    JdbcPagingListFactory pagingListFactory = new JdbcPagingListFactory(template, limitSqlAdapter);
    gDB = new JdbcScimGroupProvisioning(template, pagingListFactory);
    uDB = new JdbcScimUserProvisioning(template, pagingListFactory);
    mDB = new JdbcScimGroupMembershipManager(template, pagingListFactory);
    mDB.setScimGroupProvisioning(gDB);
    mDB.setScimUserProvisioning(uDB);

    uDB.createUser(TestUtils.scimUserInstance("dev1"), "test");
    uDB.createUser(TestUtils.scimUserInstance("dev2"), "test");
    uDB.createUser(TestUtils.scimUserInstance("dev3"), "test");
    uDB.createUser(TestUtils.scimUserInstance("qa1"), "test");
    uDB.createUser(TestUtils.scimUserInstance("qa2"), "test");
    uDB.createUser(TestUtils.scimUserInstance("mgr1"), "test");
    uDB.createUser(TestUtils.scimUserInstance("hr1"), "test");

    assertEquals(7, uDB.retrieveAll().size());
    assertEquals(0, gDB.retrieveAll().size());

    bootstrap = new ScimGroupBootstrap(gDB, uDB, mDB);
  }
 private void addUser(String id, String password, String zoneId) {
   TestUtils.assertNoSuchUser(jdbcTemplate, "id", id);
   jdbcTemplate.execute(
       String.format(addUserSqlFormat, id, id, password, id, id, id, id, "", zoneId));
 }
 private void addGroup(String id, String name, String zoneId) {
   TestUtils.assertNoSuchUser(jdbcTemplate, "id", id);
   jdbcTemplate.execute(String.format(addGroupSqlFormat, id, name, zoneId));
 }