X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sdl_private_fn_test.go;h=fae2a0285f70dc2c9212dec3a69b7d8511c1c4cb;hb=bd724d66fdfee6b1a6e589a4081529dd535ca423;hp=541ee048b25c956f23d8dc92e0f330219de2e15d;hpb=97445fe7e6737da5536c5f7a6909821a1612f66c;p=ric-plt%2Fsdlgo.git diff --git a/sdl_private_fn_test.go b/sdl_private_fn_test.go index 541ee04..fae2a02 100644 --- a/sdl_private_fn_test.go +++ b/sdl_private_fn_test.go @@ -24,11 +24,22 @@ package sdlgo //NewSdlInstanceForTest is used in unit tests only in order to replace the //underlying redis implementation with mock +//Deprecated: Will be removed in a future release. func NewSdlInstanceForTest(NameSpace string, instance iDatabase) *SdlInstance { + db := &Database{} + db.instances = append(db.instances, instance) + return &SdlInstance{ - nameSpace: NameSpace, - nsPrefix: "{" + NameSpace + "},", - eventSeparator: "___", - iDatabase: instance, + nameSpace: NameSpace, + nsPrefix: "{" + NameSpace + "},", + storage: newSyncStorage(db), } } + +// NewSyncStorageForTest is used only in unit tests to mock database. +func NewSyncStorageForTest(dbMock iDatabase) *SyncStorage { + db := &Database{} + db.instances = append(db.instances, dbMock) + + return newSyncStorage(db) +}