github.com/argoproj/argo-cd/v3@v3.2.1/util/notification/argocd/mocks/Service.go (about)

     1  // Code generated by mockery; DO NOT EDIT.
     2  // github.com/vektra/mockery
     3  // template: testify
     4  
     5  package mocks
     6  
     7  import (
     8  	"context"
     9  
    10  	"github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
    11  	"github.com/argoproj/argo-cd/v3/util/notification/expression/shared"
    12  	mock "github.com/stretchr/testify/mock"
    13  )
    14  
    15  // NewService creates a new instance of Service. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    16  // The first argument is typically a *testing.T value.
    17  func NewService(t interface {
    18  	mock.TestingT
    19  	Cleanup(func())
    20  }) *Service {
    21  	mock := &Service{}
    22  	mock.Mock.Test(t)
    23  
    24  	t.Cleanup(func() { mock.AssertExpectations(t) })
    25  
    26  	return mock
    27  }
    28  
    29  // Service is an autogenerated mock type for the Service type
    30  type Service struct {
    31  	mock.Mock
    32  }
    33  
    34  type Service_Expecter struct {
    35  	mock *mock.Mock
    36  }
    37  
    38  func (_m *Service) EXPECT() *Service_Expecter {
    39  	return &Service_Expecter{mock: &_m.Mock}
    40  }
    41  
    42  // GetAppDetails provides a mock function for the type Service
    43  func (_mock *Service) GetAppDetails(ctx context.Context, app *v1alpha1.Application) (*shared.AppDetail, error) {
    44  	ret := _mock.Called(ctx, app)
    45  
    46  	if len(ret) == 0 {
    47  		panic("no return value specified for GetAppDetails")
    48  	}
    49  
    50  	var r0 *shared.AppDetail
    51  	var r1 error
    52  	if returnFunc, ok := ret.Get(0).(func(context.Context, *v1alpha1.Application) (*shared.AppDetail, error)); ok {
    53  		return returnFunc(ctx, app)
    54  	}
    55  	if returnFunc, ok := ret.Get(0).(func(context.Context, *v1alpha1.Application) *shared.AppDetail); ok {
    56  		r0 = returnFunc(ctx, app)
    57  	} else {
    58  		if ret.Get(0) != nil {
    59  			r0 = ret.Get(0).(*shared.AppDetail)
    60  		}
    61  	}
    62  	if returnFunc, ok := ret.Get(1).(func(context.Context, *v1alpha1.Application) error); ok {
    63  		r1 = returnFunc(ctx, app)
    64  	} else {
    65  		r1 = ret.Error(1)
    66  	}
    67  	return r0, r1
    68  }
    69  
    70  // Service_GetAppDetails_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAppDetails'
    71  type Service_GetAppDetails_Call struct {
    72  	*mock.Call
    73  }
    74  
    75  // GetAppDetails is a helper method to define mock.On call
    76  //   - ctx context.Context
    77  //   - app *v1alpha1.Application
    78  func (_e *Service_Expecter) GetAppDetails(ctx interface{}, app interface{}) *Service_GetAppDetails_Call {
    79  	return &Service_GetAppDetails_Call{Call: _e.mock.On("GetAppDetails", ctx, app)}
    80  }
    81  
    82  func (_c *Service_GetAppDetails_Call) Run(run func(ctx context.Context, app *v1alpha1.Application)) *Service_GetAppDetails_Call {
    83  	_c.Call.Run(func(args mock.Arguments) {
    84  		var arg0 context.Context
    85  		if args[0] != nil {
    86  			arg0 = args[0].(context.Context)
    87  		}
    88  		var arg1 *v1alpha1.Application
    89  		if args[1] != nil {
    90  			arg1 = args[1].(*v1alpha1.Application)
    91  		}
    92  		run(
    93  			arg0,
    94  			arg1,
    95  		)
    96  	})
    97  	return _c
    98  }
    99  
   100  func (_c *Service_GetAppDetails_Call) Return(appDetail *shared.AppDetail, err error) *Service_GetAppDetails_Call {
   101  	_c.Call.Return(appDetail, err)
   102  	return _c
   103  }
   104  
   105  func (_c *Service_GetAppDetails_Call) RunAndReturn(run func(ctx context.Context, app *v1alpha1.Application) (*shared.AppDetail, error)) *Service_GetAppDetails_Call {
   106  	_c.Call.Return(run)
   107  	return _c
   108  }
   109  
   110  // GetCommitMetadata provides a mock function for the type Service
   111  func (_mock *Service) GetCommitMetadata(ctx context.Context, repoURL string, commitSHA string, project string) (*shared.CommitMetadata, error) {
   112  	ret := _mock.Called(ctx, repoURL, commitSHA, project)
   113  
   114  	if len(ret) == 0 {
   115  		panic("no return value specified for GetCommitMetadata")
   116  	}
   117  
   118  	var r0 *shared.CommitMetadata
   119  	var r1 error
   120  	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string) (*shared.CommitMetadata, error)); ok {
   121  		return returnFunc(ctx, repoURL, commitSHA, project)
   122  	}
   123  	if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string) *shared.CommitMetadata); ok {
   124  		r0 = returnFunc(ctx, repoURL, commitSHA, project)
   125  	} else {
   126  		if ret.Get(0) != nil {
   127  			r0 = ret.Get(0).(*shared.CommitMetadata)
   128  		}
   129  	}
   130  	if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string) error); ok {
   131  		r1 = returnFunc(ctx, repoURL, commitSHA, project)
   132  	} else {
   133  		r1 = ret.Error(1)
   134  	}
   135  	return r0, r1
   136  }
   137  
   138  // Service_GetCommitMetadata_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCommitMetadata'
   139  type Service_GetCommitMetadata_Call struct {
   140  	*mock.Call
   141  }
   142  
   143  // GetCommitMetadata is a helper method to define mock.On call
   144  //   - ctx context.Context
   145  //   - repoURL string
   146  //   - commitSHA string
   147  //   - project string
   148  func (_e *Service_Expecter) GetCommitMetadata(ctx interface{}, repoURL interface{}, commitSHA interface{}, project interface{}) *Service_GetCommitMetadata_Call {
   149  	return &Service_GetCommitMetadata_Call{Call: _e.mock.On("GetCommitMetadata", ctx, repoURL, commitSHA, project)}
   150  }
   151  
   152  func (_c *Service_GetCommitMetadata_Call) Run(run func(ctx context.Context, repoURL string, commitSHA string, project string)) *Service_GetCommitMetadata_Call {
   153  	_c.Call.Run(func(args mock.Arguments) {
   154  		var arg0 context.Context
   155  		if args[0] != nil {
   156  			arg0 = args[0].(context.Context)
   157  		}
   158  		var arg1 string
   159  		if args[1] != nil {
   160  			arg1 = args[1].(string)
   161  		}
   162  		var arg2 string
   163  		if args[2] != nil {
   164  			arg2 = args[2].(string)
   165  		}
   166  		var arg3 string
   167  		if args[3] != nil {
   168  			arg3 = args[3].(string)
   169  		}
   170  		run(
   171  			arg0,
   172  			arg1,
   173  			arg2,
   174  			arg3,
   175  		)
   176  	})
   177  	return _c
   178  }
   179  
   180  func (_c *Service_GetCommitMetadata_Call) Return(commitMetadata *shared.CommitMetadata, err error) *Service_GetCommitMetadata_Call {
   181  	_c.Call.Return(commitMetadata, err)
   182  	return _c
   183  }
   184  
   185  func (_c *Service_GetCommitMetadata_Call) RunAndReturn(run func(ctx context.Context, repoURL string, commitSHA string, project string) (*shared.CommitMetadata, error)) *Service_GetCommitMetadata_Call {
   186  	_c.Call.Return(run)
   187  	return _c
   188  }