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

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package automock
     4  
     5  import (
     6  	context "context"
     7  
     8  	mock "github.com/stretchr/testify/mock"
     9  
    10  	model "github.com/kyma-incubator/compass/components/director/internal/model"
    11  )
    12  
    13  // Repository is an autogenerated mock type for the Repository type
    14  type Repository struct {
    15  	mock.Mock
    16  }
    17  
    18  // Create provides a mock function with given fields: ctx, def
    19  func (_m *Repository) Create(ctx context.Context, def model.LabelDefinition) error {
    20  	ret := _m.Called(ctx, def)
    21  
    22  	var r0 error
    23  	if rf, ok := ret.Get(0).(func(context.Context, model.LabelDefinition) error); ok {
    24  		r0 = rf(ctx, def)
    25  	} else {
    26  		r0 = ret.Error(0)
    27  	}
    28  
    29  	return r0
    30  }
    31  
    32  // Exists provides a mock function with given fields: ctx, tenant, key
    33  func (_m *Repository) Exists(ctx context.Context, tenant string, key string) (bool, error) {
    34  	ret := _m.Called(ctx, tenant, key)
    35  
    36  	var r0 bool
    37  	if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok {
    38  		r0 = rf(ctx, tenant, key)
    39  	} else {
    40  		r0 = ret.Get(0).(bool)
    41  	}
    42  
    43  	var r1 error
    44  	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
    45  		r1 = rf(ctx, tenant, key)
    46  	} else {
    47  		r1 = ret.Error(1)
    48  	}
    49  
    50  	return r0, r1
    51  }
    52  
    53  // GetByKey provides a mock function with given fields: ctx, tenant, key
    54  func (_m *Repository) GetByKey(ctx context.Context, tenant string, key string) (*model.LabelDefinition, error) {
    55  	ret := _m.Called(ctx, tenant, key)
    56  
    57  	var r0 *model.LabelDefinition
    58  	if rf, ok := ret.Get(0).(func(context.Context, string, string) *model.LabelDefinition); ok {
    59  		r0 = rf(ctx, tenant, key)
    60  	} else {
    61  		if ret.Get(0) != nil {
    62  			r0 = ret.Get(0).(*model.LabelDefinition)
    63  		}
    64  	}
    65  
    66  	var r1 error
    67  	if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
    68  		r1 = rf(ctx, tenant, key)
    69  	} else {
    70  		r1 = ret.Error(1)
    71  	}
    72  
    73  	return r0, r1
    74  }
    75  
    76  // List provides a mock function with given fields: ctx, tenant
    77  func (_m *Repository) List(ctx context.Context, tenant string) ([]model.LabelDefinition, error) {
    78  	ret := _m.Called(ctx, tenant)
    79  
    80  	var r0 []model.LabelDefinition
    81  	if rf, ok := ret.Get(0).(func(context.Context, string) []model.LabelDefinition); ok {
    82  		r0 = rf(ctx, tenant)
    83  	} else {
    84  		if ret.Get(0) != nil {
    85  			r0 = ret.Get(0).([]model.LabelDefinition)
    86  		}
    87  	}
    88  
    89  	var r1 error
    90  	if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
    91  		r1 = rf(ctx, tenant)
    92  	} else {
    93  		r1 = ret.Error(1)
    94  	}
    95  
    96  	return r0, r1
    97  }
    98  
    99  // Update provides a mock function with given fields: ctx, def
   100  func (_m *Repository) Update(ctx context.Context, def model.LabelDefinition) error {
   101  	ret := _m.Called(ctx, def)
   102  
   103  	var r0 error
   104  	if rf, ok := ret.Get(0).(func(context.Context, model.LabelDefinition) error); ok {
   105  		r0 = rf(ctx, def)
   106  	} else {
   107  		r0 = ret.Error(0)
   108  	}
   109  
   110  	return r0
   111  }
   112  
   113  // Upsert provides a mock function with given fields: ctx, def
   114  func (_m *Repository) Upsert(ctx context.Context, def model.LabelDefinition) error {
   115  	ret := _m.Called(ctx, def)
   116  
   117  	var r0 error
   118  	if rf, ok := ret.Get(0).(func(context.Context, model.LabelDefinition) error); ok {
   119  		r0 = rf(ctx, def)
   120  	} else {
   121  		r0 = ret.Error(0)
   122  	}
   123  
   124  	return r0
   125  }
   126  
   127  type mockConstructorTestingTNewRepository interface {
   128  	mock.TestingT
   129  	Cleanup(func())
   130  }
   131  
   132  // NewRepository creates a new instance of Repository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
   133  func NewRepository(t mockConstructorTestingTNewRepository) *Repository {
   134  	mock := &Repository{}
   135  	mock.Mock.Test(t)
   136  
   137  	t.Cleanup(func() { mock.AssertExpectations(t) })
   138  
   139  	return mock
   140  }