Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions actor/pushaction/pushaction_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"code.cloudfoundry.org/cli/actor/pushaction/pushactionfakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/types"
types "github.com/onsi/gomega/types"

"testing"

Expand All @@ -25,8 +25,8 @@ var _ = BeforeEach(func() {
log.SetLevel(log.PanicLevel)
})

func EqualEither(events ...Event) GomegaMatcher {
var equals []GomegaMatcher
func EqualEither(events ...Event) types.GomegaMatcher {
var equals []types.GomegaMatcher
for _, event := range events {
equals = append(equals, Equal(event))
}
Expand Down
13 changes: 7 additions & 6 deletions actor/v3action/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
"code.cloudfoundry.org/cli/resources"
)

// Application represents a V3 actor application.
Expand Down Expand Up @@ -104,13 +105,13 @@ func (actor Actor) GetApplicationsByGUIDs(appGUIDs ...string) ([]Application, Wa
// name in the given space.
func (actor Actor) CreateApplicationInSpace(app Application, spaceGUID string) (Application, Warnings, error) {
createdApp, warnings, err := actor.CloudControllerClient.CreateApplication(
ccv3.Application{
resources.Application{
LifecycleType: app.LifecycleType,
LifecycleBuildpacks: app.LifecycleBuildpacks,
StackName: app.StackName,
Name: app.Name,
Relationships: ccv3.Relationships{
constant.RelationshipTypeSpace: ccv3.Relationship{GUID: spaceGUID},
Relationships: resources.Relationships{
constant.RelationshipTypeSpace: resources.Relationship{GUID: spaceGUID},
},
})

Expand Down Expand Up @@ -180,7 +181,7 @@ func (actor Actor) PollStart(appGUID string, warningsChannel chan<- Warnings) er

// UpdateApplication updates the buildpacks on an application
func (actor Actor) UpdateApplication(app Application) (Application, Warnings, error) {
ccApp := ccv3.Application{
ccApp := resources.Application{
GUID: app.GUID,
StackName: app.StackName,
LifecycleType: app.LifecycleType,
Expand All @@ -195,7 +196,7 @@ func (actor Actor) UpdateApplication(app Application) (Application, Warnings, er
return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), nil
}

func (Actor) convertCCToActorApplication(app ccv3.Application) Application {
func (Actor) convertCCToActorApplication(app resources.Application) Application {
return Application{
GUID: app.GUID,
StackName: app.StackName,
Expand All @@ -207,7 +208,7 @@ func (Actor) convertCCToActorApplication(app ccv3.Application) Application {
}
}

func (actor Actor) processStatus(process ccv3.Process, warningsChannel chan<- Warnings) (bool, error) {
func (actor Actor) processStatus(process resources.Process, warningsChannel chan<- Warnings) (bool, error) {
instances, warnings, err := actor.CloudControllerClient.GetProcessInstances(process.GUID)
warningsChannel <- Warnings(warnings)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion actor/v3action/application_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"code.cloudfoundry.org/cli/actor/v3action/v3actionfakes"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
"code.cloudfoundry.org/cli/resources"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -58,7 +59,7 @@ var _ = Describe("Application Manifest Actions", func() {
When("the app exists", func() {
BeforeEach(func() {
fakeCloudControllerClient.GetApplicationsReturns(
[]ccv3.Application{{GUID: "app-1-guid"}},
[]resources.Application{{GUID: "app-1-guid"}},
ccv3.Warnings{"app-1-warning"},
nil,
)
Expand Down
23 changes: 12 additions & 11 deletions actor/v3action/application_summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/constant"
"code.cloudfoundry.org/cli/resources"
"code.cloudfoundry.org/cli/types"

. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -49,7 +50,7 @@ var _ = Describe("Application Summary Actions", func() {
When("retrieving the application is successful", func() {
BeforeEach(func() {
fakeCloudControllerClient.GetApplicationsReturns(
[]ccv3.Application{
[]resources.Application{
{
Name: "some-app-name",
GUID: "some-app-guid",
Expand All @@ -63,14 +64,14 @@ var _ = Describe("Application Summary Actions", func() {

When("retrieving the process information is successful", func() {
BeforeEach(func() {
listedProcess := ccv3.Process{
listedProcess := resources.Process{
GUID: "some-process-guid",
Type: "some-type",
Command: *types.NewFilteredString("[Redacted Value]"),
MemoryInMB: types.NullUint64{Value: 32, IsSet: true},
}
fakeCloudControllerClient.GetApplicationProcessesReturns(
[]ccv3.Process{listedProcess},
[]resources.Process{listedProcess},
ccv3.Warnings{"some-process-warning"},
nil,
)
Expand Down Expand Up @@ -104,9 +105,9 @@ var _ = Describe("Application Summary Actions", func() {
When("app has droplet", func() {
BeforeEach(func() {
fakeCloudControllerClient.GetApplicationDropletCurrentReturns(
ccv3.Droplet{
resources.Droplet{
Stack: "some-stack",
Buildpacks: []ccv3.DropletBuildpack{
Buildpacks: []resources.DropletBuildpack{
{
Name: "some-buildpack",
},
Expand Down Expand Up @@ -187,7 +188,7 @@ var _ = Describe("Application Summary Actions", func() {
BeforeEach(func() {
expectedErr = errors.New("some error")
fakeCloudControllerClient.GetApplicationDropletCurrentReturns(
ccv3.Droplet{},
resources.Droplet{},
ccv3.Warnings{"some-droplet-warning"},
expectedErr,
)
Expand All @@ -203,7 +204,7 @@ var _ = Describe("Application Summary Actions", func() {
When("app does not have current droplet", func() {
BeforeEach(func() {
fakeCloudControllerClient.GetApplicationDropletCurrentReturns(
ccv3.Droplet{},
resources.Droplet{},
ccv3.Warnings{"some-droplet-warning"},
ccerror.DropletNotFoundError{},
)
Expand Down Expand Up @@ -270,7 +271,7 @@ var _ = Describe("Application Summary Actions", func() {

BeforeEach(func() {
fakeCloudControllerClient.GetApplicationProcessesReturns(
[]ccv3.Process{
[]resources.Process{
{
GUID: "some-process-guid",
Type: "some-type",
Expand All @@ -281,7 +282,7 @@ var _ = Describe("Application Summary Actions", func() {
)

fakeCloudControllerClient.GetApplicationProcessByTypeReturns(
ccv3.Process{},
resources.Process{},
ccv3.Warnings{"get-process-by-type-warning"},
nil,
)
Expand All @@ -306,7 +307,7 @@ var _ = Describe("Application Summary Actions", func() {

BeforeEach(func() {
fakeCloudControllerClient.GetApplicationsReturns(
[]ccv3.Application{
[]resources.Application{
{
Name: "some-app-name",
GUID: "some-app-guid",
Expand All @@ -319,7 +320,7 @@ var _ = Describe("Application Summary Actions", func() {

expectedErr = errors.New("some error")
fakeCloudControllerClient.GetApplicationProcessesReturns(
[]ccv3.Process{{Type: constant.ProcessTypeWeb}},
[]resources.Process{{Type: constant.ProcessTypeWeb}},
ccv3.Warnings{"some-process-warning"},
expectedErr,
)
Expand Down
Loading