Skip to content

Commit

Permalink
Add Missing Tests For Cassandra
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 committed Dec 2, 2024
1 parent 3863438 commit 0f2fb1b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions plugin/storage/cassandra/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ func TestCassandraFactory(t *testing.T) {
require.NoError(t, f.Close())
}

func TestCreateSpanReaderError(t *testing.T) {
session := &mocks.Session{}
query := &mocks.Query{}
session.On("Query",
mock.AnythingOfType("string"),
mock.Anything).Return(query)
session.On("Query",
mock.AnythingOfType("string"),
mock.Anything).Return(query)
query.On("Exec").Return(errors.New("table does not exist"))
f := NewFactory()
f.sessionBuilderFn = new(mockSessionBuilder).add(session, nil).build
require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop()))
r, err := f.CreateSpanReader()
require.Error(t, err)
require.Nil(t, r)
ar, err := f.CreateArchiveSpanReader()
require.Error(t, err)
require.Nil(t, ar)
}

func TestExclusiveWhitelistBlacklist(t *testing.T) {
f := NewFactory()
v, command := viperize.Viperize(f.AddFlags)
Expand Down

0 comments on commit 0f2fb1b

Please sign in to comment.