if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) (ports.CompareResult, error)); ok {
224
+
return returnFunc(ctx, p, repo, target, source)
225
+
}
226
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) ports.CompareResult); ok {
227
+
r0 = returnFunc(ctx, p, repo, target, source)
228
+
} else {
229
+
r0 = ret.Get(0).(ports.CompareResult)
230
+
}
231
+
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
232
+
r1 = returnFunc(ctx, p, repo, target, source)
233
+
} else {
234
+
r1 = ret.Error(1)
235
+
}
236
+
return r0, r1
237
+
}
238
+
239
+
// MergeRequestService_Compare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Compare'
240
+
type MergeRequestService_Compare_Call struct {
241
+
*mock.Call
242
+
}
243
+
244
+
// Compare is a helper method to define mock.On call
ret := _mock.Called(ctx, p, repo, oldHead, newTip)
1110
+
1111
+
if len(ret) == 0 {
1112
+
panic("no return value specified for PushSummary")
1113
+
}
1114
+
1115
+
var r0 ports.PushSummary
1116
+
var r1 error
1117
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) (ports.PushSummary, error)); ok {
1118
+
return returnFunc(ctx, p, repo, oldHead, newTip)
1119
+
}
1120
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) ports.PushSummary); ok {
1121
+
r0 = returnFunc(ctx, p, repo, oldHead, newTip)
1122
+
} else {
1123
+
r0 = ret.Get(0).(ports.PushSummary)
1124
+
}
1125
+
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
1126
+
r1 = returnFunc(ctx, p, repo, oldHead, newTip)
1127
+
} else {
1128
+
r1 = ret.Error(1)
1129
+
}
1130
+
return r0, r1
1131
+
}
1132
+
1133
+
// MergeRequestService_PushSummary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushSummary'
1134
+
type MergeRequestService_PushSummary_Call struct {
1135
+
*mock.Call
1136
+
}
1137
+
1138
+
// PushSummary is a helper method to define mock.On call
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) (ports.CompareResult, error)); ok {
224
+
return returnFunc(ctx, p, repo, target, source)
225
+
}
226
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) ports.CompareResult); ok {
227
+
r0 = returnFunc(ctx, p, repo, target, source)
228
+
} else {
229
+
r0 = ret.Get(0).(ports.CompareResult)
230
+
}
231
+
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
232
+
r1 = returnFunc(ctx, p, repo, target, source)
233
+
} else {
234
+
r1 = ret.Error(1)
235
+
}
236
+
return r0, r1
237
+
}
238
+
239
+
// MergeRequestService_Compare_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Compare'
240
+
type MergeRequestService_Compare_Call struct {
241
+
*mock.Call
242
+
}
243
+
244
+
// Compare is a helper method to define mock.On call
ret := _mock.Called(ctx, p, repo, oldHead, newTip)
1110
+
1111
+
if len(ret) == 0 {
1112
+
panic("no return value specified for PushSummary")
1113
+
}
1114
+
1115
+
var r0 ports.PushSummary
1116
+
var r1 error
1117
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) (ports.PushSummary, error)); ok {
1118
+
return returnFunc(ctx, p, repo, oldHead, newTip)
1119
+
}
1120
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) ports.PushSummary); ok {
1121
+
r0 = returnFunc(ctx, p, repo, oldHead, newTip)
1122
+
} else {
1123
+
r0 = ret.Get(0).(ports.PushSummary)
1124
+
}
1125
+
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.Principal, domain.RepoName, domain.ObjectID, domain.ObjectID) error); ok {
1126
+
r1 = returnFunc(ctx, p, repo, oldHead, newTip)
1127
+
} else {
1128
+
r1 = ret.Error(1)
1129
+
}
1130
+
return r0, r1
1131
+
}
1132
+
1133
+
// MergeRequestService_PushSummary_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushSummary'
1134
+
type MergeRequestService_PushSummary_Call struct {
1135
+
*mock.Call
1136
+
}
1137
+
1138
+
// PushSummary is a helper method to define mock.On call
// RotateKey provides a mock function for the type OIDCKeyService
95
// RotateKey provides a mock function for the type OIDCKeyService
52
func (_mock *OIDCKeyService) RotateKey(ctx context.Context, p domain.Principal) (ports.OIDCRotation, error) {
96
func (_mock *OIDCKeyService) RotateKey(ctx context.Context, p domain.Principal) (ports.OIDCRotation, error) {
53
ret := _mock.Called(ctx, p)
97
ret := _mock.Called(ctx, p)
Ainternal/ports/mocks/PushTreeReader.go+223-0
@@ -0,0 +1,223 @@
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
+
"bnema.dev/ermite/internal/domain"
11
+
"bnema.dev/ermite/internal/ports"
12
+
mock "github.com/stretchr/testify/mock"
13
+
)
14
+
15
+
// NewPushTreeReader creates a new instance of PushTreeReader. 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 NewPushTreeReader(t interface {
18
+
mock.TestingT
19
+
Cleanup(func())
20
+
}) *PushTreeReader {
21
+
if helper, ok := t.(interface{ Helper() }); ok {
22
+
helper.Helper()
23
+
}
24
+
25
+
mock := &PushTreeReader{}
26
+
mock.Mock.Test(t)
27
+
28
+
t.Cleanup(func() {
29
+
if helper, ok := t.(interface{ Helper() }); ok {
30
+
helper.Helper()
31
+
}
32
+
mock.AssertExpectations(t)
33
+
})
34
+
35
+
return mock
36
+
}
37
+
38
+
// PushTreeReader is an autogenerated mock type for the PushTreeReader type
ret := _mock.Called(ctx, repo, updates, objects, path, bounds)
138
+
139
+
if len(ret) == 0 {
140
+
panic("no return value specified for PushSubtrees")
141
+
}
142
+
143
+
var r0 domain.PushSubtrees
144
+
var r1 error
145
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) (domain.PushSubtrees, error)); ok {
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) domain.PushSubtrees); ok {
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) error); ok {
// NewPushTreeReader creates a new instance of PushTreeReader. 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 NewPushTreeReader(t interface {
18
+
mock.TestingT
19
+
Cleanup(func())
20
+
}) *PushTreeReader {
21
+
if helper, ok := t.(interface{ Helper() }); ok {
22
+
helper.Helper()
23
+
}
24
+
25
+
mock := &PushTreeReader{}
26
+
mock.Mock.Test(t)
27
+
28
+
t.Cleanup(func() {
29
+
if helper, ok := t.(interface{ Helper() }); ok {
30
+
helper.Helper()
31
+
}
32
+
mock.AssertExpectations(t)
33
+
})
34
+
35
+
return mock
36
+
}
37
+
38
+
// PushTreeReader is an autogenerated mock type for the PushTreeReader type
ret := _mock.Called(ctx, repo, updates, objects, path, bounds)
138
+
139
+
if len(ret) == 0 {
140
+
panic("no return value specified for PushSubtrees")
141
+
}
142
+
143
+
var r0 domain.PushSubtrees
144
+
var r1 error
145
+
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) (domain.PushSubtrees, error)); ok {
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) domain.PushSubtrees); ok {
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, []domain.RefUpdate, ports.PushObjects, string, domain.PushWalkBounds) error); ok {
// NewWorkflowGuard creates a new instance of WorkflowGuard. 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 NewWorkflowGuard(t interface {
18
-
mock.TestingT
19
-
Cleanup(func())
20
-
}) *WorkflowGuard {
21
-
if helper, ok := t.(interface{ Helper() }); ok {
22
-
helper.Helper()
23
-
}
24
-
25
-
mock := &WorkflowGuard{}
26
-
mock.Mock.Test(t)
27
-
28
-
t.Cleanup(func() {
29
-
if helper, ok := t.(interface{ Helper() }); ok {
30
-
helper.Helper()
31
-
}
32
-
mock.AssertExpectations(t)
33
-
})
34
-
35
-
return mock
36
-
}
37
-
38
-
// WorkflowGuard is an autogenerated mock type for the WorkflowGuard type
// NewWorkflowGuard creates a new instance of WorkflowGuard. 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 NewWorkflowGuard(t interface {
18
-
mock.TestingT
19
-
Cleanup(func())
20
-
}) *WorkflowGuard {
21
-
if helper, ok := t.(interface{ Helper() }); ok {
22
-
helper.Helper()
23
-
}
24
-
25
-
mock := &WorkflowGuard{}
26
-
mock.Mock.Test(t)
27
-
28
-
t.Cleanup(func() {
29
-
if helper, ok := t.(interface{ Helper() }); ok {
30
-
helper.Helper()
31
-
}
32
-
mock.AssertExpectations(t)
33
-
})
34
-
35
-
return mock
36
-
}
37
-
38
-
// WorkflowGuard is an autogenerated mock type for the WorkflowGuard type
Reviewed (correctness/security + architecture/maintainability/tests), findings fixed or deferred (GO-005 wiring, GO-011/012 budget loop factoring). Rebased on main 4534992. Build, vet, gofmt, hexcheck -fail-on warn, go test ./internal/... and -race on touched packages pass.