Skip to content

Commit

Permalink
chore: migrate from unmaintained mockgen (evcc-io#11547)
Browse files Browse the repository at this point in the history
The golang mock package has been archived and is now maintained by uber.

> Update, June 2023: This repo and tool are no longer maintained. Please
> see go.uber.org/mock for a maintained fork instead.

[1] https://github.com/golang/mock
[2] https://github.com/uber-go/mock
  • Loading branch information
mweinelt committed Jan 8, 2024
1 parent e8c900d commit daee304
Show file tree
Hide file tree
Showing 22 changed files with 412 additions and 43 deletions.
17 changes: 11 additions & 6 deletions api/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions charger/eebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"github.com/evcc-io/evcc/util"
)

//go:generate mockgen -package charger -destination eebus_test_mock.go github.com/enbility/cemd/emobility EmobilityI

const (
maxIdRequestTimespan = time.Second * 120
idleFactor = 0.6
Expand Down
5 changes: 2 additions & 3 deletions charger/eebus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package charger
import (
"testing"

"github.com/enbility/cemd/emobility"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"
)

func TestEEBusIsCharging(t *testing.T) {
Expand Down Expand Up @@ -117,7 +116,7 @@ func TestEEBusIsCharging(t *testing.T) {
for index, m := range tc.measurements {
ctrl := gomock.NewController(t)

emobilityMock := emobility.NewMockEmobilityI(ctrl)
emobilityMock := NewMockEmobilityI(ctrl)
eebus := &EEBus{
emobility: emobilityMock,
}
Expand Down
Loading

0 comments on commit daee304

Please sign in to comment.