Exemplo n.º 1
0
func New(token string) Api {
	return &PivnetApi{
		Requester: resource.NewRequester("https://network.pivotal.io", token),
	}
}
Exemplo n.º 2
0
		testRelease        *resource.Release
		testProductFiles   *resource.ProductFiles
		pivotalProductFile resource.ProductFile
		licenseProductFile resource.ProductFile
		eulaMessage        resource.EulaMessage
	)

	verifyHeaders := ghttp.CombineHandlers(
		ghttp.VerifyHeaderKV("Authorization", "Token token"),
		ghttp.VerifyHeaderKV("Content-Type", "application/json"),
		ghttp.VerifyHeaderKV("Accept", "application/json"),
	)

	BeforeEach(func() {
		server = ghttp.NewServer()
		req = resource.NewRequester(server.URL(), "token")

		testRelease = &resource.Release{
			Id:      123,
			Version: "1.1",
			Links: resource.Links{
				"product_files": resource.Link{Url: server.URL() + "/api/v2/products/my-prod/releases/123/product_files"},
			},
		}

		pivotalProductFile = resource.ProductFile{
			Id:           200,
			AwsObjectKey: "my-prod.pivotal",
			FileVersion:  "2.0.0",
			Links: resource.Links{
				"download": resource.Link{Url: server.URL() + "/api/v2/products/my-prod/releases/123/product_files/200/download"},