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

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