From 7dd6e2f9e3725427c628b214cb31bda1dbe95234 Mon Sep 17 00:00:00 2001 From: Shashank Kumar Shankar Date: Tue, 20 Mar 2018 16:48:05 -0700 Subject: Make datastore generic to support Consul/Cassandra This patch makes the backend datastore to be generic so that the backend datastore can be either Consul or Cassandra. This way, MUSIC's core functionality can be used and makes other minor fixes. Change-Id: Iba4eaa751fe60a293d6f2fd60ad06a8c4be1dd1e Issue-ID: MUSIC-55 Signed-off-by: Shashank Kumar Shankar --- src/dkv/api/configHandlers_test.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/dkv/api/configHandlers_test.go') diff --git a/src/dkv/api/configHandlers_test.go b/src/dkv/api/configHandlers_test.go index e2f796a..bb11eb1 100644 --- a/src/dkv/api/configHandlers_test.go +++ b/src/dkv/api/configHandlers_test.go @@ -75,14 +75,14 @@ func TestHandleConfigDelete_err(t *testing.T) { } func TestHandleConfigPOST(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsul{} + Datastore = &FakeConsul{} KeyValues = &FakeKeyValues{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() @@ -104,14 +104,14 @@ func TestHandleConfigPOST(t *testing.T) { } func TestHandleConfigPOST_only_token(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsul{} + Datastore = &FakeConsul{} KeyValues = &FakeKeyValues{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() @@ -133,14 +133,14 @@ func TestHandleConfigPOST_only_token(t *testing.T) { } func TestHandleConfigPOST_no_body(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsul{} + Datastore = &FakeConsul{} KeyValues = &FakeKeyValues{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() @@ -156,14 +156,14 @@ func TestHandleConfigPOST_no_body(t *testing.T) { } func TestHandleConfigPOST_ConsulError(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsulErr{} + Datastore = &FakeConsulErr{} KeyValues = &FakeKeyValuesErr{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() @@ -196,14 +196,14 @@ func TestHandleConfigUpload_err(t *testing.T) { } func TestHandleDefaultConfigLoad(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsul{} + Datastore = &FakeConsul{} KeyValues = &FakeKeyValues{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() @@ -215,14 +215,14 @@ func TestHandleDefaultConfigLoad(t *testing.T) { } func TestHandleDefaultConfigLoad_err(t *testing.T) { - oldConsul := Consul + oldDatastore := Datastore oldKeyValues := KeyValues - Consul = &FakeConsul{} + Datastore = &FakeConsul{} KeyValues = &FakeKeyValuesErr{} defer func() { - Consul = oldConsul + Datastore = oldDatastore KeyValues = oldKeyValues }() -- cgit 1.2.3-korg