mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
2f91679623
This change adds a core_generate_all make target. It installs the required tools and runs generate on the complete project. `golang/mock` is no longer maintained and a fork is available from the Uber folks. So the latter is used as tool. All the mock files have been regenerated and are part of the PR. The obsolete `tools` directory has been removed, as all the tools are now part of specific make targets. Co-authored-by: Silvan <silvan.reusser@gmail.com>
34 lines
734 B
Go
34 lines
734 B
Go
package mock
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"go.uber.org/mock/gomock"
|
|
)
|
|
|
|
func NewIDGenerator(t *testing.T) *MockGenerator {
|
|
m := NewMockGenerator(gomock.NewController(t))
|
|
m.EXPECT().Next().Return("1", nil)
|
|
return m
|
|
}
|
|
|
|
func NewIDGeneratorExpectIDs(t *testing.T, ids ...string) *MockGenerator {
|
|
m := NewMockGenerator(gomock.NewController(t))
|
|
for _, id := range ids {
|
|
m.EXPECT().Next().Return(id, nil)
|
|
}
|
|
return m
|
|
}
|
|
|
|
func ExpectID(t *testing.T, id string) *MockGenerator {
|
|
m := NewMockGenerator(gomock.NewController(t))
|
|
m.EXPECT().Next().Return(id, nil)
|
|
return m
|
|
}
|
|
|
|
func NewIDGeneratorExpectError(t *testing.T, err error) *MockGenerator {
|
|
m := NewMockGenerator(gomock.NewController(t))
|
|
m.EXPECT().Next().Return("", err)
|
|
return m
|
|
}
|