コード例 #1
0
ファイル: update_service_test.go プロジェクト: nttlabs/cli
	"github.com/nttlabs/cli/cf/models"
	testcmd "github.com/nttlabs/cli/testhelpers/commands"
	testconfig "github.com/nttlabs/cli/testhelpers/configuration"
	testreq "github.com/nttlabs/cli/testhelpers/requirements"
	testterm "github.com/nttlabs/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	. "github.com/nttlabs/cli/testhelpers/matchers"
)

var _ = Describe("update-service command", func() {
	var (
		ui                  *testterm.FakeUI
		config              core_config.Repository
		requirementsFactory *testreq.FakeReqFactory
		serviceRepo         *testapi.FakeServiceRepo
		planBuilder         *testplanbuilder.FakePlanBuilder
		offering1           models.ServiceOffering
	)

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		config = testconfig.NewRepositoryWithDefaults()
		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
		serviceRepo = &testapi.FakeServiceRepo{}
		planBuilder = &testplanbuilder.FakePlanBuilder{}

		offering1 = models.ServiceOffering{}
		offering1.Label = "cleardb"
		offering1.Plans = []models.ServicePlanFields{{
			Name: "spark",
コード例 #2
0
ファイル: service_builder_test.go プロジェクト: nttlabs/cli
import (
	plan_builder_fakes "github.com/nttlabs/cli/cf/actors/plan_builder/fakes"
	"github.com/nttlabs/cli/cf/actors/service_builder"
	testapi "github.com/nttlabs/cli/cf/api/fakes"

	"github.com/nttlabs/cli/cf/models"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Service Builder", func() {
	var (
		planBuilder    *plan_builder_fakes.FakePlanBuilder
		serviceBuilder service_builder.ServiceBuilder
		serviceRepo    *testapi.FakeServiceRepo
		service1       models.ServiceOffering
		plan1          models.ServicePlanFields
		plan2          models.ServicePlanFields
	)

	BeforeEach(func() {
		serviceRepo = &testapi.FakeServiceRepo{}
		planBuilder = &plan_builder_fakes.FakePlanBuilder{}

		serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
		service1 = models.ServiceOffering{
			ServiceOfferingFields: models.ServiceOfferingFields{
				Label:      "my-service1",
				Guid:       "service-guid1",
				BrokerGuid: "my-service-broker-guid1",
			},