zitadel/internal/id/mock/generator.mock.impl.go
Tim Möhlmann 2f91679623
chore(Makefile): add go generate target (#6944)
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>
2023-11-22 10:56:43 +00:00

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
}