Skip to content

Commit

Permalink
Adding tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jul 23, 2024
1 parent 10c2d7c commit b92d914
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/dynamo/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ func TestTransformAttributeValue(t *testing.T) {
assert.Equal(t, float64(123), actualValue)
assert.Equal(t, debezium.Float, fieldType)
}
{
// Bytes
actualValue, fieldType, err := transformAttributeValue(&dynamodb.AttributeValue{
B: []byte("hello"),
})
assert.NoError(t, err, err)
assert.Equal(t, []byte("hello"), actualValue)
assert.Equal(t, debezium.Bytes, fieldType)
}
{
// Bytes set
actualValue, fieldType, err := transformAttributeValue(&dynamodb.AttributeValue{
BS: [][]byte{
[]byte("hello"),
},
})
assert.NoError(t, err, err)
assert.Equal(t, [][]byte{[]byte("hello")}, actualValue)
assert.Equal(t, debezium.Array, fieldType)
}
{
// Boolean
actualValue, fieldType, err := transformAttributeValue(&dynamodb.AttributeValue{
Expand Down

0 comments on commit b92d914

Please sign in to comment.