Skip to content

Commit

Permalink
Write more tests for cassandra/domain.go
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanisikdemir committed Apr 4, 2024
1 parent 7a7f629 commit 53b8e66
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 16 deletions.
10 changes: 2 additions & 8 deletions common/persistence/nosql/nosqlplugin/cassandra/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ const (
// Insert a new record to domain
// return types.DomainAlreadyExistsError error if failed or already exists
// Must return ConditionFailure error if other condition doesn't match
func (db *cdb) InsertDomain(
ctx context.Context,
row *nosqlplugin.DomainRow,
) error {
func (db *cdb) InsertDomain(ctx context.Context, row *nosqlplugin.DomainRow) error {
query := db.session.Query(templateCreateDomainQuery, row.Info.ID, row.Info.Name).WithContext(ctx)
applied, err := query.MapScanCAS(make(map[string]interface{}))
if err != nil {
Expand Down Expand Up @@ -163,10 +160,7 @@ func (db *cdb) updateMetadataBatch(
}

// Update domain
func (db *cdb) UpdateDomain(
ctx context.Context,
row *nosqlplugin.DomainRow,
) error {
func (db *cdb) UpdateDomain(ctx context.Context, row *nosqlplugin.DomainRow) error {
batch := db.session.NewBatch(gocql.LoggedBatch).WithContext(ctx)
failoverEndTime := emptyFailoverEndTime
if row.FailoverEndTime != nil {
Expand Down
Loading

0 comments on commit 53b8e66

Please sign in to comment.