github.com/kyma-incubator/compass/components/director@v0.0.0-20230623144113-d764f56ff805/internal/domain/apptemplate/automock/application_template_service.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package automock
     4  
     5  import (
     6  	context "context"
     7  
     8  	labelfilter "github.com/kyma-incubator/compass/components/director/internal/labelfilter"
     9  	mock "github.com/stretchr/testify/mock"
    10  
    11  	model "github.com/kyma-incubator/compass/components/director/internal/model"
    12  )
    13  
    14  // ApplicationTemplateService is an autogenerated mock type for the ApplicationTemplateService type
    15  type ApplicationTemplateService struct {
    16  	mock.Mock
    17  }
    18  
    19  // Create provides a mock function with given fields: ctx, in
    20  func (_m *ApplicationTemplateService) Create(ctx context.Context, in model.ApplicationTemplateInput) (string, error) {
    21  	ret := _m.Called(ctx, in)
    22  
    23  	var r0 string
    24  	if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput) string); ok {
    25  		r0 = rf(ctx, in)
    26  	} else {
    27  		r0 = ret.Get(0).(string)
    28  	}
    29  
    30  	var r1 error
    31  	if rf, ok := ret.Get(1).(func(context.Context, model.ApplicationTemplateInput) error); ok {
    32  		r1 = rf(ctx, in)
    33  	} else {
    34  		r1 = ret.Error(1)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  // CreateWithLabels provides a mock function with given fields: ctx, in, labels
    41  func (_m *ApplicationTemplateService) CreateWithLabels(ctx context.Context, in model.ApplicationTemplateInput, labels map[string]interface{}) (string, error) {
    42  	ret := _m.Called(ctx, in, labels)
    43  
    44  	var r0 string
    45  	if rf, ok := ret.Get(0).(func(context.Context, model.ApplicationTemplateInput, map[string]interface{}) string); ok {
    46  		r0 = rf(ctx, in, labels)
    47  	} else {
    48  		r0 = ret.Get(0).(string)
    49  	}
    50  
    51  	var r1 error
    52  	if rf, ok := ret.Get(1).(func(context.Context, model.ApplicationTemplateInput, map[string]interface{}) error); ok {
    53  		r1 = rf(ctx, in, labels)
    54  	} else {
    55  		r1 = ret.Error(1)
    56  	}
    57  
    58  	return r0, r1
    59  }
    60  
    61  // Delete provides a mock function with given fields: ctx, id
    62  func (_m *ApplicationTemplateService) Delete(ctx context.Context, id string) error {
    63  	ret := _m.Called(ctx, id)
    64  
    65  	var r0 error
    66  	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
    67  		r0 = rf(ctx, id)
    68  	} else {
    69  		r0 = ret.Error(0)
    70  	}
    71  
    72  	return r0
    73  }
    74  
    75  // Get provides a mock function with given fields: ctx, id
    76  func (_m *ApplicationTemplateService) Get(ctx context.Context, id string) (*model.ApplicationTemplate, error) {
    77  	ret := _m.Called(ctx, id)
    78  
    79  	var r0 *model.ApplicationTemplate
    80  	if rf, ok := ret.Get(0).(func(context.Context, string) *model.ApplicationTemplate); ok {
    81  		r0 = rf(ctx, id)
    82  	} else {
    83  		if ret.Get(0) != nil {
    84  			r0 = ret.Get(0).(*model.ApplicationTemplate)
    85  		}
    86  	}
    87  
    88  	var r1 error
    89  	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
    90  		r1 = rf(ctx, id)
    91  	} else {
    92  		r1 = ret.Error(1)
    93  	}
    94  
    95  	return r0, r1
    96  }
    97  
    98  // GetByFilters provides a mock function with given fields: ctx, filter
    99  func (_m *ApplicationTemplateService) GetByFilters(ctx context.Context, filter []*labelfilter.LabelFilter) (*model.ApplicationTemplate, error) {
   100  	ret := _m.Called(ctx, filter)
   101  
   102  	var r0 *model.ApplicationTemplate
   103  	if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) *model.ApplicationTemplate); ok {
   104  		r0 = rf(ctx, filter)
   105  	} else {
   106  		if ret.Get(0) != nil {
   107  			r0 = ret.Get(0).(*model.ApplicationTemplate)
   108  		}
   109  	}
   110  
   111  	var r1 error
   112  	if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter) error); ok {
   113  		r1 = rf(ctx, filter)
   114  	} else {
   115  		r1 = ret.Error(1)
   116  	}
   117  
   118  	return r0, r1
   119  }
   120  
   121  // GetByNameAndRegion provides a mock function with given fields: ctx, name, region
   122  func (_m *ApplicationTemplateService) GetByNameAndRegion(ctx context.Context, name string, region interface{}) (*model.ApplicationTemplate, error) {
   123  	ret := _m.Called(ctx, name, region)
   124  
   125  	var r0 *model.ApplicationTemplate
   126  	if rf, ok := ret.Get(0).(func(context.Context, string, interface{}) *model.ApplicationTemplate); ok {
   127  		r0 = rf(ctx, name, region)
   128  	} else {
   129  		if ret.Get(0) != nil {
   130  			r0 = ret.Get(0).(*model.ApplicationTemplate)
   131  		}
   132  	}
   133  
   134  	var r1 error
   135  	if rf, ok := ret.Get(1).(func(context.Context, string, interface{}) error); ok {
   136  		r1 = rf(ctx, name, region)
   137  	} else {
   138  		r1 = ret.Error(1)
   139  	}
   140  
   141  	return r0, r1
   142  }
   143  
   144  // GetLabel provides a mock function with given fields: ctx, appTemplateID, key
   145  func (_m *ApplicationTemplateService) GetLabel(ctx context.Context, appTemplateID string, key string) (*model.Label, error) {
   146  	ret := _m.Called(ctx, appTemplateID, key)
   147  
   148  	var r0 *model.Label
   149  	if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.Label); ok {
   150  		r0 = rf(ctx, appTemplateID, key)
   151  	} else {
   152  		if ret.Get(0) != nil {
   153  			r0 = ret.Get(0).(*model.Label)
   154  		}
   155  	}
   156  
   157  	var r1 error
   158  	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
   159  		r1 = rf(ctx, appTemplateID, key)
   160  	} else {
   161  		r1 = ret.Error(1)
   162  	}
   163  
   164  	return r0, r1
   165  }
   166  
   167  // List provides a mock function with given fields: ctx, filter, pageSize, cursor
   168  func (_m *ApplicationTemplateService) List(ctx context.Context, filter []*labelfilter.LabelFilter, pageSize int, cursor string) (model.ApplicationTemplatePage, error) {
   169  	ret := _m.Called(ctx, filter, pageSize, cursor)
   170  
   171  	var r0 model.ApplicationTemplatePage
   172  	if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter, int, string) model.ApplicationTemplatePage); ok {
   173  		r0 = rf(ctx, filter, pageSize, cursor)
   174  	} else {
   175  		r0 = ret.Get(0).(model.ApplicationTemplatePage)
   176  	}
   177  
   178  	var r1 error
   179  	if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter, int, string) error); ok {
   180  		r1 = rf(ctx, filter, pageSize, cursor)
   181  	} else {
   182  		r1 = ret.Error(1)
   183  	}
   184  
   185  	return r0, r1
   186  }
   187  
   188  // ListByFilters provides a mock function with given fields: ctx, filter
   189  func (_m *ApplicationTemplateService) ListByFilters(ctx context.Context, filter []*labelfilter.LabelFilter) ([]*model.ApplicationTemplate, error) {
   190  	ret := _m.Called(ctx, filter)
   191  
   192  	var r0 []*model.ApplicationTemplate
   193  	if rf, ok := ret.Get(0).(func(context.Context, []*labelfilter.LabelFilter) []*model.ApplicationTemplate); ok {
   194  		r0 = rf(ctx, filter)
   195  	} else {
   196  		if ret.Get(0) != nil {
   197  			r0 = ret.Get(0).([]*model.ApplicationTemplate)
   198  		}
   199  	}
   200  
   201  	var r1 error
   202  	if rf, ok := ret.Get(1).(func(context.Context, []*labelfilter.LabelFilter) error); ok {
   203  		r1 = rf(ctx, filter)
   204  	} else {
   205  		r1 = ret.Error(1)
   206  	}
   207  
   208  	return r0, r1
   209  }
   210  
   211  // ListByName provides a mock function with given fields: ctx, name
   212  func (_m *ApplicationTemplateService) ListByName(ctx context.Context, name string) ([]*model.ApplicationTemplate, error) {
   213  	ret := _m.Called(ctx, name)
   214  
   215  	var r0 []*model.ApplicationTemplate
   216  	if rf, ok := ret.Get(0).(func(context.Context, string) []*model.ApplicationTemplate); ok {
   217  		r0 = rf(ctx, name)
   218  	} else {
   219  		if ret.Get(0) != nil {
   220  			r0 = ret.Get(0).([]*model.ApplicationTemplate)
   221  		}
   222  	}
   223  
   224  	var r1 error
   225  	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
   226  		r1 = rf(ctx, name)
   227  	} else {
   228  		r1 = ret.Error(1)
   229  	}
   230  
   231  	return r0, r1
   232  }
   233  
   234  // ListLabels provides a mock function with given fields: ctx, appTemplateID
   235  func (_m *ApplicationTemplateService) ListLabels(ctx context.Context, appTemplateID string) (map[string]*model.Label, error) {
   236  	ret := _m.Called(ctx, appTemplateID)
   237  
   238  	var r0 map[string]*model.Label
   239  	if rf, ok := ret.Get(0).(func(context.Context, string) map[string]*model.Label); ok {
   240  		r0 = rf(ctx, appTemplateID)
   241  	} else {
   242  		if ret.Get(0) != nil {
   243  			r0 = ret.Get(0).(map[string]*model.Label)
   244  		}
   245  	}
   246  
   247  	var r1 error
   248  	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
   249  		r1 = rf(ctx, appTemplateID)
   250  	} else {
   251  		r1 = ret.Error(1)
   252  	}
   253  
   254  	return r0, r1
   255  }
   256  
   257  // PrepareApplicationCreateInputJSON provides a mock function with given fields: appTemplate, values
   258  func (_m *ApplicationTemplateService) PrepareApplicationCreateInputJSON(appTemplate *model.ApplicationTemplate, values model.ApplicationFromTemplateInputValues) (string, error) {
   259  	ret := _m.Called(appTemplate, values)
   260  
   261  	var r0 string
   262  	if rf, ok := ret.Get(0).(func(*model.ApplicationTemplate, model.ApplicationFromTemplateInputValues) string); ok {
   263  		r0 = rf(appTemplate, values)
   264  	} else {
   265  		r0 = ret.Get(0).(string)
   266  	}
   267  
   268  	var r1 error
   269  	if rf, ok := ret.Get(1).(func(*model.ApplicationTemplate, model.ApplicationFromTemplateInputValues) error); ok {
   270  		r1 = rf(appTemplate, values)
   271  	} else {
   272  		r1 = ret.Error(1)
   273  	}
   274  
   275  	return r0, r1
   276  }
   277  
   278  // Update provides a mock function with given fields: ctx, id, in
   279  func (_m *ApplicationTemplateService) Update(ctx context.Context, id string, in model.ApplicationTemplateUpdateInput) error {
   280  	ret := _m.Called(ctx, id, in)
   281  
   282  	var r0 error
   283  	if rf, ok := ret.Get(0).(func(context.Context, string, model.ApplicationTemplateUpdateInput) error); ok {
   284  		r0 = rf(ctx, id, in)
   285  	} else {
   286  		r0 = ret.Error(0)
   287  	}
   288  
   289  	return r0
   290  }
   291  
   292  type mockConstructorTestingTNewApplicationTemplateService interface {
   293  	mock.TestingT
   294  	Cleanup(func())
   295  }
   296  
   297  // NewApplicationTemplateService creates a new instance of ApplicationTemplateService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   298  func NewApplicationTemplateService(t mockConstructorTestingTNewApplicationTemplateService) *ApplicationTemplateService {
   299  	mock := &ApplicationTemplateService{}
   300  	mock.Mock.Test(t)
   301  
   302  	t.Cleanup(func() { mock.AssertExpectations(t) })
   303  
   304  	return mock
   305  }