Skip to content

Commit

Permalink
Add Update Instance / Create Binding Service Schemas (#238)
Browse files Browse the repository at this point in the history
* Add tests for broker update service instance schema

Signed-off-by: Alex Blease <[email protected]>

* Add test for broker create service binding schema

Signed-off-by: Alex Blease <[email protected]>
  • Loading branch information
Samze authored and selzoc committed Sep 20, 2017
1 parent a1eded4 commit cc4c327
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions helpers/services/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ type PlanSchemas struct {
Create struct {
Parameters map[string]interface{} `json:"parameters"`
} `json:"create"`
Update struct {
Parameters map[string]interface{} `json:"parameters"`
} `json:"update"`
} `json:"service_instance"`
ServiceBinding struct {
Create struct {
Parameters map[string]interface{} `json:"parameters"`
} `json:"create"`
} `json:"service_binding"`
}

type ServiceBroker struct {
Expand Down
16 changes: 15 additions & 1 deletion services/service_broker_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ var _ = ServicesDescribe("Service Broker Lifecycle", func() {

var emptySchemas PlanSchemas
emptySchemas.ServiceInstance.Create.Parameters = map[string]interface{}{}
emptySchemas.ServiceInstance.Update.Parameters = map[string]interface{}{}
emptySchemas.ServiceBinding.Create.Parameters = map[string]interface{}{}

Expect(plansResponse.Resources[0].Entity.Schemas).To(Equal(emptySchemas))

Expand All @@ -80,7 +82,19 @@ var _ = ServicesDescribe("Service Broker Lifecycle", func() {

var basicSchema PlanSchemas
basicSchema.ServiceInstance.Create.Parameters = map[string]interface{}{
"$schema": "http://json-schema.org/draft-04/schema#", "type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "create instance schema",
}
basicSchema.ServiceInstance.Update.Parameters = map[string]interface{}{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "update instance schema",
}
basicSchema.ServiceBinding.Create.Parameters = map[string]interface{}{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "create binding schema",
}
broker.SyncPlans[0].Schemas = basicSchema

Expand Down

0 comments on commit cc4c327

Please sign in to comment.