forked from cloudfoundry/go-cfclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service_brokers_test.go
31 lines (26 loc) · 934 Bytes
/
service_brokers_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package cfclient
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestListServiceBrokers(t *testing.T) {
Convey("List Service Brokers", t, func() {
setup(MockRoute{"GET", "/v2/service_brokers", listServiceBrokersPayload, "", 200, "", nil}, t)
defer teardown()
c := &Config{
ApiAddress: server.URL,
Token: "foobar",
}
client, err := NewClient(c)
So(err, ShouldBeNil)
servicePlans, err := client.ListServiceBrokers()
So(err, ShouldBeNil)
So(len(servicePlans), ShouldEqual, 1)
So(servicePlans[0].Guid, ShouldEqual, "90a413fd-a636-4133-8bfb-a94b07839e96")
So(servicePlans[0].Name, ShouldEqual, "name-85")
So(servicePlans[0].BrokerURL, ShouldEqual, "https://foo.com/url-2")
So(servicePlans[0].Username, ShouldEqual, "auth_username-2")
So(servicePlans[0].SpaceGUID, ShouldEqual, "1d43e64d-ed64-43dd-9046-11f422bd407b")
So(servicePlans[0].Password, ShouldBeEmpty)
})
}