refactor(storage): Remove decommissioned path for memory store (#313)

This commit is contained in:
TwiN
2022-08-11 20:42:56 -04:00
committed by GitHub
parent 262d436533
commit f01b66f083
11 changed files with 61 additions and 79 deletions

View File

@ -89,7 +89,7 @@ type Scenario struct {
}
func initStoresAndBaseScenarios(t *testing.T, testName string) []*Scenario {
memoryStore, err := memory.NewStore("")
memoryStore, err := memory.NewStore()
if err != nil {
t.Fatal("failed to create store:", err.Error())
}
@ -528,17 +528,17 @@ func TestStore_DeleteAllEndpointStatusesNotInKeys(t *testing.T) {
scenario.Store.Insert(&firstEndpoint, result)
scenario.Store.Insert(&secondEndpoint, result)
if ss, _ := scenario.Store.GetEndpointStatusByKey(firstEndpoint.Key(), paging.NewEndpointStatusParams()); ss == nil {
t.Fatal("firstEndpoint should exist")
t.Fatal("firstEndpoint should exist, got", ss)
}
if ss, _ := scenario.Store.GetEndpointStatusByKey(secondEndpoint.Key(), paging.NewEndpointStatusParams()); ss == nil {
t.Fatal("secondEndpoint should exist")
t.Fatal("secondEndpoint should exist, got", ss)
}
scenario.Store.DeleteAllEndpointStatusesNotInKeys([]string{firstEndpoint.Key()})
if ss, _ := scenario.Store.GetEndpointStatusByKey(firstEndpoint.Key(), paging.NewEndpointStatusParams()); ss == nil {
t.Error("secondEndpoint should've been deleted")
t.Error("secondEndpoint should still exist, got", ss)
}
if ss, _ := scenario.Store.GetEndpointStatusByKey(secondEndpoint.Key(), paging.NewEndpointStatusParams()); ss != nil {
t.Error("firstEndpoint should still exist")
t.Error("firstEndpoint should have been deleted, got", ss)
}
// Delete everything
scenario.Store.DeleteAllEndpointStatusesNotInKeys([]string{})