File tree 2 files changed +25
-4
lines changed
2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,26 @@ var _ = Describe("Service Broker API", func() {
205
205
Expect (fakeServiceBroker .ProvisionedInstanceIDs ).To (ContainElement (instanceID ))
206
206
})
207
207
208
+ Context ("when there are arbitrary params" , func () {
209
+ BeforeEach (func () {
210
+ serviceDetails .Parameters = map [string ]interface {}{
211
+ "string" : "some-string" ,
212
+ "number" : 1 ,
213
+ "object" : struct { Name string }{"some-name" },
214
+ "array" : []interface {}{"a" , "b" , "c" },
215
+ }
216
+ })
217
+
218
+ It ("calls Provision on the service broker with all params" , func () {
219
+ makeInstanceProvisioningRequest (instanceID , serviceDetails )
220
+ Expect (fakeServiceBroker .ServiceDetails .Parameters ["string" ]).To (Equal ("some-string" ))
221
+ Expect (fakeServiceBroker .ServiceDetails .Parameters ["number" ]).To (Equal (1.0 ))
222
+ Expect (fakeServiceBroker .ServiceDetails .Parameters ["array" ]).To (Equal ([]interface {}{"a" , "b" , "c" }))
223
+ actual , _ := fakeServiceBroker .ServiceDetails .Parameters ["object" ].(map [string ]interface {})
224
+ Expect (actual ["Name" ]).To (Equal ("some-name" ))
225
+ })
226
+ })
227
+
208
228
Context ("when the instance does not exist" , func () {
209
229
It ("returns a 201" , func () {
210
230
response := makeInstanceProvisioningRequest (instanceID , serviceDetails )
Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ type ServiceBroker interface {
13
13
}
14
14
15
15
type ServiceDetails struct {
16
- ID string `json:"service_id"`
17
- PlanID string `json:"plan_id"`
18
- OrganizationGUID string `json:"organization_guid"`
19
- SpaceGUID string `json:"space_guid"`
16
+ ID string `json:"service_id"`
17
+ PlanID string `json:"plan_id"`
18
+ OrganizationGUID string `json:"organization_guid"`
19
+ SpaceGUID string `json:"space_guid"`
20
+ Parameters map [string ]interface {} `json:"parameters"`
20
21
}
21
22
22
23
var (
You can’t perform that action at this time.
0 commit comments