Code Review
/
ric-plt
/
a1.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
UT for SetPolicyInstanceStatus
[ric-plt/a1.git]
/
a1-go
/
pkg
/
resthooks
/
resthooks_test.go
diff --git
a/a1-go/pkg/resthooks/resthooks_test.go
b/a1-go/pkg/resthooks/resthooks_test.go
index
8c6b59a
..
8003df7
100644
(file)
--- a/
a1-go/pkg/resthooks/resthooks_test.go
+++ b/
a1-go/pkg/resthooks/resthooks_test.go
@@
-51,13
+51,24
@@
func TestMain(m *testing.M) {
"a1.policy_type.20000",
"a1.policy_inst_metadata.1006001.qos",
}, nil)
"a1.policy_type.20000",
"a1.policy_inst_metadata.1006001.qos",
}, nil)
-
RMRclient = new(RMRClient
Mock)
+
rmrSenderInst = new(RmrSender
Mock)
a1.Init()
a1.Init()
- rh = createResthook(sdlInst,
RMRclien
t)
+ rh = createResthook(sdlInst,
rmrSenderIns
t)
code := m.Run()
os.Exit(code)
}
code := m.Run()
os.Exit(code)
}
+func TestHealth(t *testing.T) {
+ resp := rh.GetA1Health()
+ if resp == true {
+ a1.Logger.Debug("A1 is healthy ")
+ assert.Equal(t, true, resp)
+ } else {
+ a1.Logger.Debug("A1 is unhealthy")
+ assert.Equal(t, false, resp)
+ }
+}
+
func TestGetAllPolicyType(t *testing.T) {
resp := rh.GetAllPolicyType()
assert.Equal(t, 2, len(resp))
func TestGetAllPolicyType(t *testing.T) {
resp := rh.GetAllPolicyType()
assert.Equal(t, 2, len(resp))