import (
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/vito/cmdtest/matchers"

	. "github.com/cloudfoundry/cf-acceptance-tests/helpers"
	"github.com/cloudfoundry/cf-acceptance-tests/services/helpers"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
	"github.com/pivotal-cf-experimental/cf-test-helpers/generator"
)

var _ = Describe("Service Broker Lifecycle", func() {
	var broker helpers.ServiceBroker

	BeforeEach(func() {
		helpers.LoginAsAdmin()
		broker = helpers.NewServiceBroker(generator.RandomName(), NewAssets().ServiceBroker)
		broker.Push()
		broker.Configure()
	})

	AfterEach(func() {
		helpers.LoginAsUser()
	})

	It("confirms correct behavior in the lifecycle of a service broker", func() {
		defer helpers.Recover() // Catches panic thrown by Require expectations
import (
	"time"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/vito/cmdtest/matchers"

	. "github.com/cloudfoundry/cf-acceptance-tests/helpers"
	"github.com/cloudfoundry/cf-acceptance-tests/services/helpers"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
	"github.com/pivotal-cf-experimental/cf-test-helpers/generator"
)

var _ = Describe("Purging service offerings", func() {
	var broker helpers.ServiceBroker

	BeforeEach(func() {
		helpers.LoginAsAdmin()

		broker = helpers.NewServiceBroker(generator.RandomName(), NewAssets().ServiceBroker)
		broker.Push()
		broker.Configure()
		broker.Create(LoadConfig().AppsDomain)
		broker.PublicizePlans()
	})

	AfterEach(func() {
		broker.Destroy()
		helpers.LoginAsUser()
	})
package services

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/vito/cmdtest/matchers"

	. "github.com/cloudfoundry/cf-acceptance-tests/helpers"
	"github.com/cloudfoundry/cf-acceptance-tests/services/helpers"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
	"github.com/pivotal-cf-experimental/cf-test-helpers/generator"
)

var _ = Describe("Service Broker Lifecycle", func() {
	var broker helpers.ServiceBroker

	BeforeEach(func() {
		broker = helpers.NewServiceBroker(generator.RandomName(), NewAssets().ServiceBroker)
		broker.Push()
		broker.Configure()
	})

	It("confirms correct behavior in the lifecycle of a service broker", func() {
		// Adding the service broker
		broker.Create(LoadConfig().AppsDomain)

		// Confirming the plans are not yet public
		session := Cf("marketplace")
		Expect(session).NotTo(Say(broker.Service.Name))
		Expect(session).NotTo(Say(broker.Plan.Name))