Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsaporiti committed Dec 19, 2024
1 parent b8111bb commit 7d3fe57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/api/identity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,16 @@ func TestServer_CreateAuthCredential(t *testing.T) {
key, err := server.keyService.Create(ctx, issuerDID, kms.KeyTypeBabyJubJub, uuid.New().String())
require.NoError(t, err)

authCredentialExpiration := time.Now().UTC().Unix()

revNonce, err := common.RandInt64()
require.NoError(t, err)
body := CreateAuthCredentialRequest{
KeyID: key.ID,
CredentialStatusType: CreateAuthCredentialRequestCredentialStatusType(verifiable.Iden3commRevocationStatusV1),
RevNonce: &revNonce,
Version: common.ToPointer[uint32](1),
Expiration: common.ToPointer[int64](1829174400),
Expiration: common.ToPointer[int64](authCredentialExpiration),
}
rr := httptest.NewRecorder()
req, err := http.NewRequest("POST", fmt.Sprintf("/v2/identities/%s/create-auth-credential", did), tests.JSONBody(t, body))
Expand All @@ -616,6 +618,6 @@ func TestServer_CreateAuthCredential(t *testing.T) {
require.True(t, ok)
assert.Equal(t, float64(revNonce), status["revocationNonce"])
assert.Equal(t, string(verifiable.Iden3commRevocationStatusV1), status["type"])
assert.Equal(t, *response2.Vc.Expiration, time.Unix(1829174400, 0).Local())
assert.Equal(t, authCredentialExpiration, response2.Vc.Expiration.UTC().Unix())
})
}

0 comments on commit 7d3fe57

Please sign in to comment.