X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sdl_test.go;h=8dc999698a6e78ea209fbdbcc83fae19308467cb;hb=refs%2Fchanges%2F62%2F6062%2F1;hp=acacfd67fd4eb13e16811ea4b2763e2af8647a62;hpb=cf2b20b2b54f9ca26e3faa48ee52981c05565796;p=ric-plt%2Fsdlgo.git diff --git a/sdl_test.go b/sdl_test.go index acacfd6..8dc9996 100644 --- a/sdl_test.go +++ b/sdl_test.go @@ -169,6 +169,24 @@ func verifySliceInOrder(a, b []string) bool { } +func TestClose(t *testing.T) { + m, i := setup() + + m.On("CloseDB").Return(nil) + err := i.Close() + assert.Nil(t, err) + m.AssertExpectations(t) +} + +func TestCloseReturnError(t *testing.T) { + m, i := setup() + + m.On("CloseDB").Return(errors.New("Some error")) + err := i.Close() + assert.NotNil(t, err) + m.AssertExpectations(t) +} + func TestSubscribeChannel(t *testing.T) { m, i := setup() @@ -591,8 +609,8 @@ func TestRemoveAndPublishIncorrectChannel(t *testing.T) { m.AssertNotCalled(t, "DelMPub", notExpectedChannelAndEvent, notExpectedKeys) m.AssertNotCalled(t, "Del", notExpectedKeys) - err := i.RemoveAndPublish([]string{"channel", "event", "channel2"}, []string{}) - assert.Nil(t, err) + err := i.RemoveAndPublish([]string{"channel", "event", "channel2"}, []string{"key1", "key2"}) + assert.NotNil(t, err) m.AssertExpectations(t) }