Skip to content

Commit

Permalink
APIGOV-23681 - added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekschauhan committed Sep 23, 2022
1 parent b7af713 commit 9203705
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/agent/handler/credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ func Test_creds(t *testing.T) {
"def": "789",
},
id: "cred-id",
credSchema: map[string]interface{}{
"properties": "test",
},
credProvSchema: map[string]interface{}{
"properties": "test",
},
}

assert.Equal(t, c.managedApp, c.GetApplicationName())
Expand All @@ -418,11 +424,20 @@ func Test_creds(t *testing.T) {
assert.Equal(t, c.credData, c.GetCredentialData())
assert.Equal(t, c.credDetails["abc"], c.GetCredentialDetailsValue("abc"))
assert.Equal(t, c.appDetails["def"], c.GetApplicationDetailsValue("def"))
assert.Equal(t, c.credSchema, c.GetCredentialSchema())
assert.Equal(t, c.credProvSchema, c.GetCredentialProvisionSchema())
assert.Empty(t, c.GetCredentialSchemaDetailsValue("prop"))

c.credSchemaDetails = map[string]interface{}{
"detail": "test",
}
assert.Equal(t, c.credSchemaDetails["prop"], c.GetCredentialSchemaDetailsValue("prop"))

c.credDetails = nil
c.appDetails = nil
assert.Empty(t, c.GetApplicationDetailsValue("app_details_key"))
assert.Empty(t, c.GetCredentialDetailsValue("access_details_key"))
assert.Empty(t, c.GetCredentialSchemaDetailsValue("invalid_key"))
}

func TestIDPCredentialProvisioning(t *testing.T) {
Expand Down

0 comments on commit 9203705

Please sign in to comment.