From f26131f52327a2b2c5438881ebd02ed51a11ae85 Mon Sep 17 00:00:00 2001 From: Ryan Walls Date: Sun, 17 Apr 2016 10:48:38 -0600 Subject: [PATCH] Create mocks package --- mocks/StateOps.go | 71 +++++++++++++++++++++++++++++++++++++++++++++++ state.go | 2 +- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 mocks/StateOps.go diff --git a/mocks/StateOps.go b/mocks/StateOps.go new file mode 100644 index 0000000..bb84e58 --- /dev/null +++ b/mocks/StateOps.go @@ -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() +} diff --git a/state.go b/state.go index 06c35be..8745ec0 100644 --- a/state.go +++ b/state.go @@ -1,4 +1,4 @@ -package scheduler +package ecsstate // StateOps is the interface for refreshing and interacting with the local // ECS state.