Skip to content

Commit

Permalink
modify Blob Validate(...) test
Browse files Browse the repository at this point in the history
  • Loading branch information
MGTheTrain committed Nov 18, 2024
1 parent a95497b commit b41a4d0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/unit/domain/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func TestBlobValidation(t *testing.T) {
EncryptionAlgorithm: "AES",
HashAlgorithm: "SHA256",
IsEncrypted: true,
IsSigned: false,
CryptographicKey: model.CryptographicKey{KeyID: "abc123", KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: "e2b073b5-3e23-4fbd-b44b-c607b04c9c3e"},
KeyID: "abc123",
IsSigned: false, // Explicitly set to false
CryptographicKey: model.CryptographicKey{KeyID: uuid.New().String(), KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: uuid.New().String()},
KeyID: uuid.New().String(), // Use valid UUID here
}

// Validate the valid Blob
Expand All @@ -45,8 +45,8 @@ func TestBlobValidation(t *testing.T) {
HashAlgorithm: "SHA256",
IsEncrypted: true,
IsSigned: false,
CryptographicKey: model.CryptographicKey{KeyID: "abc123", KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: "e2b073b5-3e23-4fbd-b44b-c607b04c9c3e"},
KeyID: "abc123",
CryptographicKey: model.CryptographicKey{KeyID: uuid.New().String(), KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: uuid.New().String()},
KeyID: uuid.New().String(), // Use valid UUID
}

// Validate the invalid Blob
Expand All @@ -72,8 +72,8 @@ func TestBlobValidationEdgeCases(t *testing.T) {
HashAlgorithm: "SHA256",
IsEncrypted: true,
IsSigned: false,
CryptographicKey: model.CryptographicKey{KeyID: "abc123", KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: "e2b073b5-3e23-4fbd-b44b-c607b04c9c3e"},
KeyID: "abc123",
CryptographicKey: model.CryptographicKey{KeyID: uuid.New().String(), KeyType: "AES", CreatedAt: time.Now(), ExpiresAt: time.Now().Add(24 * time.Hour), UserID: uuid.New().String()},
KeyID: uuid.New().String(),
}

err := invalidBlob.Validate()
Expand Down

0 comments on commit b41a4d0

Please sign in to comment.