Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
timl3136 committed Oct 11, 2024
1 parent 174a3ec commit 40643c8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions common/types/replicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1282,3 +1282,24 @@ func TestSyncShardStatus_GetTimestamp(t *testing.T) {
res = nilStruct.GetTimestamp()
assert.Equal(t, int64(0), res)
}

func TestGetDomainReplicationMessagesRequest_SerializeForLogging(t *testing.T) {
// Test case where the struct is nil
var nilStruct *GetDomainReplicationMessagesRequest
res, err := nilStruct.SerializeForLogging()
assert.Equal(t, "", res)
assert.NoError(t, err)

// Test case with a non-nil struct
lastRetrievedMessageID := int64(12345)
lastProcessedMessageID := int64(67890)
testStruct := GetDomainReplicationMessagesRequest{
LastRetrievedMessageID: &lastRetrievedMessageID,
LastProcessedMessageID: &lastProcessedMessageID,
ClusterName: "test-cluster",
}

res, err = testStruct.SerializeForLogging()
assert.NotEmpty(t, res)
assert.NoError(t, err)
}

0 comments on commit 40643c8

Please sign in to comment.