Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/integration/role/roleapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ var (
Parent: nil,
}

testUserSchema = testutils.UserSchema{
Name: "person",
Schema: map[string]interface{}{
"email": map[string]interface{}{
"type": "string",
},
"firstName": map[string]interface{}{
"type": "string",
},
"lastName": map[string]interface{}{
"type": "string",
},
"password": map[string]interface{}{
"type": "string",
},
},
}

testUser1 = testutils.User{
Type: "person",
Attributes: json.RawMessage(`{
Expand Down Expand Up @@ -82,6 +100,7 @@ var (
testUserID2 string
testGroupID string
sharedRoleID string // Shared role created in SetupSuite for tests that need a pre-existing role
userSchemaID string
)

type RoleAPITestSuite struct {
Expand All @@ -101,6 +120,11 @@ func (suite *RoleAPITestSuite) SetupSuite() {
},
}

// Create user schema
schemaID, err := testutils.CreateUserType(testUserSchema)
suite.Require().NoError(err, "Failed to create user schema")
userSchemaID = schemaID

// Create test organization unit
ouID, err := testutils.CreateOrganizationUnit(testOU)
suite.Require().NoError(err, "Failed to create test organization unit")
Expand Down Expand Up @@ -148,6 +172,9 @@ func (suite *RoleAPITestSuite) TearDownSuite() {
if testUserID1 != "" {
_ = testutils.DeleteUser(testUserID1)
}
if userSchemaID != "" {
_ = testutils.DeleteUserType(userSchemaID)
}
if testOUID != "" {
_ = testutils.DeleteOrganizationUnit(testOUID)
}
Expand Down
Loading