summaryrefslogtreecommitdiffstats
path: root/src/dkv/api/configHandlers_test.go
diff options
context:
space:
mode:
authorShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2018-03-20 16:48:05 -0700
committerShashank Kumar Shankar <shashank.kumar.shankar@intel.com>2018-03-22 16:42:43 -0700
commit7dd6e2f9e3725427c628b214cb31bda1dbe95234 (patch)
tree3d76c2aed17003fb13d7ca734ff63e2ff99d63b6 /src/dkv/api/configHandlers_test.go
parent1f99187b2ec49a132bd82b40bc4cd02d79cbd416 (diff)
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 <shashank.kumar.shankar@intel.com>
Diffstat (limited to 'src/dkv/api/configHandlers_test.go')
-rw-r--r--src/dkv/api/configHandlers_test.go36
1 files changed, 18 insertions, 18 deletions
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
}()