summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/brokerhandler_test.go
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-16 20:58:34 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-16 20:58:34 -0700
commit3775c137dd3381ae4e180f827ca90f8543a50999 (patch)
treeaf8a324db898e2d1b241a9c335767c2fe0eae5ce /src/k8splugin/api/brokerhandler_test.go
parentc8d038951d41978bb00005e23081e6562c0ab754 (diff)
Support user_directives that are attributes lists
Support the attributes in user_directives attributes are lists of the following form: "attributes": [ { "attribute_value": "foo", "attribute_name": "bar" }, { "attribute_value": "value2", "attribute_name": "name2" } ] Issue-ID: ONAPARC-349 Change-Id: I576bc251d1566dc26696f12f826a09bacb7417a0 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/api/brokerhandler_test.go')
-rw-r--r--src/k8splugin/api/brokerhandler_test.go30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/k8splugin/api/brokerhandler_test.go b/src/k8splugin/api/brokerhandler_test.go
index 16046634..e7ff08c4 100644
--- a/src/k8splugin/api/brokerhandler_test.go
+++ b/src/k8splugin/api/brokerhandler_test.go
@@ -52,8 +52,17 @@ func TestBrokerCreateHandler(t *testing.T) {
input: bytes.NewBuffer([]byte(`{
"vf-module-model-customization-id": "84sdfkio938",
"user_directives": {
- "definition-name": "test-rbdef",
- "definition-version": "v1" }
+ "attributes": [
+ {
+ "attribute_name": "definition-name",
+ "attribute_value": "test-rbdef"
+ },
+ {
+ "attribute_name": "definition-version",
+ "attribute_value": "v1"
+ }
+ ]
+ }
}`)),
expectedCode: http.StatusBadRequest,
},
@@ -62,9 +71,20 @@ func TestBrokerCreateHandler(t *testing.T) {
input: bytes.NewBuffer([]byte(`{
"vf-module-model-customization-id": "84sdfkio938",
"user_directives": {
- "definition-name": "test-rbdef",
- "definition-version": "v1",
- "profile-name": "profile1"
+ "attributes": [
+ {
+ "attribute_name": "definition-name",
+ "attribute_value": "test-rbdef"
+ },
+ {
+ "attribute_name": "definition-version",
+ "attribute_value": "v1"
+ },
+ {
+ "attribute_name": "profile-name",
+ "attribute_value": "profile1"
+ }
+ ]
}
}`)),
expected: brokerPOSTResponse{