Skip to content

Commit

Permalink
Create mocks package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Walls committed Apr 17, 2016
1 parent 5266f56 commit f26131f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
71 changes: 71 additions & 0 deletions mocks/StateOps.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package mocks

import (
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/stretchr/testify/mock"
)

type StateOps struct {
mock.Mock
}

// Initialize provides a mock function with given fields: clusterName, ecs, logger
func (_m *StateOps) Initialize(clusterName string, ecs *ecs.ECS, logger scheduler.Logger) *scheduler.State {
ret := _m.Called(clusterName, ecs, logger)

var r0 *scheduler.State
if rf, ok := ret.Get(0).(func(string, *ecs.ECS, scheduler.Logger) *scheduler.State); ok {
r0 = rf(clusterName, ecs, logger)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*scheduler.State)
}
}

return r0
}

// FindLocationsForTaskDefinition provides a mock function with given fields: td
func (_m *StateOps) FindLocationsForTaskDefinition(td string) *[]scheduler.ContainerInstance {
ret := _m.Called(td)

var r0 *[]scheduler.ContainerInstance
if rf, ok := ret.Get(0).(func(string) *[]scheduler.ContainerInstance); ok {
r0 = rf(td)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*[]scheduler.ContainerInstance)
}
}

return r0
}

// FindTaskDefinition provides a mock function with given fields: td
func (_m *StateOps) FindTaskDefinition(td string) scheduler.TaskDefinition {
ret := _m.Called(td)

var r0 scheduler.TaskDefinition
if rf, ok := ret.Get(0).(func(string) scheduler.TaskDefinition); ok {
r0 = rf(td)
} else {
r0 = ret.Get(0).(scheduler.TaskDefinition)
}

return r0
}

// RefreshClusterState provides a mock function with given fields:
func (_m *StateOps) RefreshClusterState() {
_m.Called()
}

// RefreshContainerInstanceState provides a mock function with given fields:
func (_m *StateOps) RefreshContainerInstanceState() {
_m.Called()
}

// RefreshTaskState provides a mock function with given fields:
func (_m *StateOps) RefreshTaskState() {
_m.Called()
}
2 changes: 1 addition & 1 deletion state.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scheduler
package ecsstate

// StateOps is the interface for refreshing and interacting with the local
// ECS state.
Expand Down

0 comments on commit f26131f

Please sign in to comment.