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
Get All Policy Type Instance
[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
50a7fe2
..
98d4f8c
100644
(file)
--- a/
a1-go/pkg/resthooks/resthooks_test.go
+++ b/
a1-go/pkg/resthooks/resthooks_test.go
@@
-39,6
+39,8
@@
func TestMain(m *testing.M) {
sdlInst = new(SdlMock)
sdlInst.On("GetAll", "A1m_ns").Return([]string{"a1.policy_instance.1006001.qos",
sdlInst = new(SdlMock)
sdlInst.On("GetAll", "A1m_ns").Return([]string{"a1.policy_instance.1006001.qos",
+ "a1.policy_instance.20005.123456",
+ "a1.policy_instance.20005.234567",
"a1.policy_type.1006001",
"a1.policy_type.20000",
"a1.policy_inst_metadata.1006001.qos",
"a1.policy_type.1006001",
"a1.policy_type.20000",
"a1.policy_inst_metadata.1006001.qos",
@@
-161,6
+163,13
@@
func TestGetPolicyInstance(t *testing.T) {
sdlInst.AssertExpectations(t)
}
sdlInst.AssertExpectations(t)
}
+func TestGetAllPolicyIntances(t *testing.T) {
+ var policyTypeId models.PolicyTypeID
+ policyTypeId = 20005
+ resp := rh.GetAllPolicyInstance(policyTypeId)
+ assert.Equal(t, 2, len(resp))
+}
+
type SdlMock struct {
mock.Mock
}
type SdlMock struct {
mock.Mock
}