From 0aa6e534a1b54ebbb4104f3316aad9f4c68610f7 Mon Sep 17 00:00:00 2001 From: "Jorge L. Fatta" Date: Fri, 12 Mar 2021 18:55:45 -0300 Subject: [PATCH] test: token retriever --- internal/auth/auth.go | 1 + internal/auth/mock/auth.go | 76 ++++++++ internal/auth/token_test.go | 88 +++++++++ internal/auth0/actions_mock.go | 313 ++++++++++++++++++++++++++++++--- 4 files changed, 452 insertions(+), 26 deletions(-) create mode 100644 internal/auth/mock/auth.go create mode 100644 internal/auth/token_test.go diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 878c6f57b..2bec08b66 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -1,3 +1,4 @@ +//go:generate mockgen -source auth.go -destination mock/auth.go -package mock package auth import ( diff --git a/internal/auth/mock/auth.go b/internal/auth/mock/auth.go new file mode 100644 index 000000000..97ac03c84 --- /dev/null +++ b/internal/auth/mock/auth.go @@ -0,0 +1,76 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: auth.go + +// Package mock is a generated GoMock package. +package mock + +import ( + gomock "github.com/golang/mock/gomock" + reflect "reflect" +) + +// MockSecretStore is a mock of SecretStore interface +type MockSecretStore struct { + ctrl *gomock.Controller + recorder *MockSecretStoreMockRecorder +} + +// MockSecretStoreMockRecorder is the mock recorder for MockSecretStore +type MockSecretStoreMockRecorder struct { + mock *MockSecretStore +} + +// NewMockSecretStore creates a new mock instance +func NewMockSecretStore(ctrl *gomock.Controller) *MockSecretStore { + mock := &MockSecretStore{ctrl: ctrl} + mock.recorder = &MockSecretStoreMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockSecretStore) EXPECT() *MockSecretStoreMockRecorder { + return m.recorder +} + +// Set mocks base method +func (m *MockSecretStore) Set(namespace, key, value string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Set", namespace, key, value) + ret0, _ := ret[0].(error) + return ret0 +} + +// Set indicates an expected call of Set +func (mr *MockSecretStoreMockRecorder) Set(namespace, key, value interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockSecretStore)(nil).Set), namespace, key, value) +} + +// Get mocks base method +func (m *MockSecretStore) Get(namespace, key string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Get", namespace, key) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Get indicates an expected call of Get +func (mr *MockSecretStoreMockRecorder) Get(namespace, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockSecretStore)(nil).Get), namespace, key) +} + +// Delete mocks base method +func (m *MockSecretStore) Delete(namespace, key string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delete", namespace, key) + ret0, _ := ret[0].(error) + return ret0 +} + +// Delete indicates an expected call of Delete +func (mr *MockSecretStoreMockRecorder) Delete(namespace, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSecretStore)(nil).Delete), namespace, key) +} diff --git a/internal/auth/token_test.go b/internal/auth/token_test.go new file mode 100644 index 000000000..3ab991ec4 --- /dev/null +++ b/internal/auth/token_test.go @@ -0,0 +1,88 @@ +package auth + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "testing" + + "github.com/auth0/auth0-cli/internal/auth/mock" + "github.com/golang/mock/gomock" +) + +// HTTPTransport implements an http.RoundTripper for testing purposes only. +type testTransport struct { + withResponse *http.Response + withError error + requests []*http.Request +} + +func (t *testTransport) RoundTrip(req *http.Request) (*http.Response, error) { + t.requests = append(t.requests, req) + return t.withResponse, t.withError +} + +func TestTokenRetriever_Refresh(t *testing.T) { + t.Run("happy path", func(t *testing.T) { + ctrl := gomock.NewController(t) + defer ctrl.Finish() + + secretsMock := mock.NewMockSecretStore(ctrl) + secretsMock.EXPECT().Get("auth0-cli", "mytenant").Return("refresh-token-here", nil).Times(1) + + transport := &testTransport{ + withResponse: &http.Response{ + StatusCode: http.StatusOK, + Body: ioutil.NopCloser(bytes.NewReader([]byte(`{ + "access_token": "access-token-here", + "id_token": "id-token-here", + "token_type": "token-type-here", + "expires_in": 1000 + }`))), + }, + } + + client := &http.Client{Transport: transport} + + tr := &TokenRetriever{ + Secrets: secretsMock, + Client: client, + } + + got, err := tr.Refresh(context.Background(), "mytenant") + if err != nil { + t.Fatal(err) + } + + want := TokenResponse{ + AccessToken: "access-token-here", + IDToken: "id-token-here", + TokenType: "token-type-here", + ExpiresIn: 1000, + } + + if want != got { + t.Fatalf("wanted: %v, got: %v", want, got) + } + + req := transport.requests[0] + err = req.ParseForm() + if err != nil { + t.Fatal(err) + } + + if want, got := "https://auth0.auth0.com/oauth/token", req.URL.String(); want != got { + t.Fatalf("wanted request URL: %v, got: %v", want, got) + } + if want, got := "refresh_token", req.Form["grant_type"][0]; want != got { + t.Fatalf("wanted grant_type: %v, got: %v", want, got) + } + if want, got := "2iZo3Uczt5LFHacKdM0zzgUO2eG2uDjT", req.Form["client_id"][0]; want != got { + t.Fatalf("wanted grant_type: %v, got: %v", want, got) + } + if want, got := "refresh-token-here", req.Form["refresh_token"][0]; want != got { + t.Fatalf("wanted grant_type: %v, got: %v", want, got) + } + }) +} diff --git a/internal/auth0/actions_mock.go b/internal/auth0/actions_mock.go index 88b45b45e..4c19b92d1 100644 --- a/internal/auth0/actions_mock.go +++ b/internal/auth0/actions_mock.go @@ -10,31 +10,31 @@ import ( reflect "reflect" ) -// MockActionsAPI is a mock of ActionsAPI interface -type MockActionsAPI struct { +// MockActionAPI is a mock of ActionAPI interface +type MockActionAPI struct { ctrl *gomock.Controller - recorder *MockActionsAPIMockRecorder + recorder *MockActionAPIMockRecorder } -// MockActionsAPIMockRecorder is the mock recorder for MockActionsAPI -type MockActionsAPIMockRecorder struct { - mock *MockActionsAPI +// MockActionAPIMockRecorder is the mock recorder for MockActionAPI +type MockActionAPIMockRecorder struct { + mock *MockActionAPI } -// NewMockActionsAPI creates a new mock instance -func NewMockActionsAPI(ctrl *gomock.Controller) *MockActionsAPI { - mock := &MockActionsAPI{ctrl: ctrl} - mock.recorder = &MockActionsAPIMockRecorder{mock} +// NewMockActionAPI creates a new mock instance +func NewMockActionAPI(ctrl *gomock.Controller) *MockActionAPI { + mock := &MockActionAPI{ctrl: ctrl} + mock.recorder = &MockActionAPIMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use -func (m *MockActionsAPI) EXPECT() *MockActionsAPIMockRecorder { +func (m *MockActionAPI) EXPECT() *MockActionAPIMockRecorder { return m.recorder } // Create mocks base method -func (m *MockActionsAPI) Create(a *management.Action) error { +func (m *MockActionAPI) Create(a *management.Action) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Create", a) ret0, _ := ret[0].(error) @@ -42,13 +42,13 @@ func (m *MockActionsAPI) Create(a *management.Action) error { } // Create indicates an expected call of Create -func (mr *MockActionsAPIMockRecorder) Create(a interface{}) *gomock.Call { +func (mr *MockActionAPIMockRecorder) Create(a interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockActionsAPI)(nil).Create), a) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockActionAPI)(nil).Create), a) } // Read mocks base method -func (m *MockActionsAPI) Read(id string) (*management.Action, error) { +func (m *MockActionAPI) Read(id string) (*management.Action, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Read", id) ret0, _ := ret[0].(*management.Action) @@ -57,13 +57,13 @@ func (m *MockActionsAPI) Read(id string) (*management.Action, error) { } // Read indicates an expected call of Read -func (mr *MockActionsAPIMockRecorder) Read(id interface{}) *gomock.Call { +func (mr *MockActionAPIMockRecorder) Read(id interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockActionsAPI)(nil).Read), id) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockActionAPI)(nil).Read), id) } // Update mocks base method -func (m *MockActionsAPI) Update(id string, a *management.Action) error { +func (m *MockActionAPI) Update(id string, a *management.Action) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Update", id, a) ret0, _ := ret[0].(error) @@ -71,13 +71,13 @@ func (m *MockActionsAPI) Update(id string, a *management.Action) error { } // Update indicates an expected call of Update -func (mr *MockActionsAPIMockRecorder) Update(id, a interface{}) *gomock.Call { +func (mr *MockActionAPIMockRecorder) Update(id, a interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockActionsAPI)(nil).Update), id, a) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockActionAPI)(nil).Update), id, a) } // Delete mocks base method -func (m *MockActionsAPI) Delete(id string, opts ...management.RequestOption) error { +func (m *MockActionAPI) Delete(id string, opts ...management.RequestOption) error { m.ctrl.T.Helper() varargs := []interface{}{id} for _, a := range opts { @@ -89,14 +89,14 @@ func (m *MockActionsAPI) Delete(id string, opts ...management.RequestOption) err } // Delete indicates an expected call of Delete -func (mr *MockActionsAPIMockRecorder) Delete(id interface{}, opts ...interface{}) *gomock.Call { +func (mr *MockActionAPIMockRecorder) Delete(id interface{}, opts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{id}, opts...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockActionsAPI)(nil).Delete), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockActionAPI)(nil).Delete), varargs...) } // List mocks base method -func (m *MockActionsAPI) List(opts ...management.RequestOption) (*management.ActionList, error) { +func (m *MockActionAPI) List(opts ...management.RequestOption) (*management.ActionList, error) { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range opts { @@ -109,7 +109,268 @@ func (m *MockActionsAPI) List(opts ...management.RequestOption) (*management.Act } // List indicates an expected call of List -func (mr *MockActionsAPIMockRecorder) List(opts ...interface{}) *gomock.Call { +func (mr *MockActionAPIMockRecorder) List(opts ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockActionsAPI)(nil).List), opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockActionAPI)(nil).List), opts...) +} + +// MockActionVersionAPI is a mock of ActionVersionAPI interface +type MockActionVersionAPI struct { + ctrl *gomock.Controller + recorder *MockActionVersionAPIMockRecorder +} + +// MockActionVersionAPIMockRecorder is the mock recorder for MockActionVersionAPI +type MockActionVersionAPIMockRecorder struct { + mock *MockActionVersionAPI +} + +// NewMockActionVersionAPI creates a new mock instance +func NewMockActionVersionAPI(ctrl *gomock.Controller) *MockActionVersionAPI { + mock := &MockActionVersionAPI{ctrl: ctrl} + mock.recorder = &MockActionVersionAPIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockActionVersionAPI) EXPECT() *MockActionVersionAPIMockRecorder { + return m.recorder +} + +// Create mocks base method +func (m *MockActionVersionAPI) Create(actionID string, v *management.ActionVersion) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Create", actionID, v) + ret0, _ := ret[0].(error) + return ret0 +} + +// Create indicates an expected call of Create +func (mr *MockActionVersionAPIMockRecorder) Create(actionID, v interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockActionVersionAPI)(nil).Create), actionID, v) +} + +// Read mocks base method +func (m *MockActionVersionAPI) Read(actionID, id string) (*management.ActionVersion, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Read", actionID, id) + ret0, _ := ret[0].(*management.ActionVersion) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Read indicates an expected call of Read +func (mr *MockActionVersionAPIMockRecorder) Read(actionID, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockActionVersionAPI)(nil).Read), actionID, id) +} + +// UpsertDraft mocks base method +func (m *MockActionVersionAPI) UpsertDraft(actionID string, v *management.ActionVersion) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpsertDraft", actionID, v) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertDraft indicates an expected call of UpsertDraft +func (mr *MockActionVersionAPIMockRecorder) UpsertDraft(actionID, v interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertDraft", reflect.TypeOf((*MockActionVersionAPI)(nil).UpsertDraft), actionID, v) +} + +// ReadDraft mocks base method +func (m *MockActionVersionAPI) ReadDraft(actionID string) (*management.ActionVersion, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReadDraft", actionID) + ret0, _ := ret[0].(*management.ActionVersion) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReadDraft indicates an expected call of ReadDraft +func (mr *MockActionVersionAPIMockRecorder) ReadDraft(actionID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReadDraft", reflect.TypeOf((*MockActionVersionAPI)(nil).ReadDraft), actionID) +} + +// Delete mocks base method +func (m *MockActionVersionAPI) Delete(actionID, id string, opts ...management.RequestOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{actionID, id} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Delete", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// Delete indicates an expected call of Delete +func (mr *MockActionVersionAPIMockRecorder) Delete(actionID, id interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{actionID, id}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockActionVersionAPI)(nil).Delete), varargs...) +} + +// List mocks base method +func (m *MockActionVersionAPI) List(actionID string, opts ...management.RequestOption) (*management.ActionVersionList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{actionID} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].(*management.ActionVersionList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// List indicates an expected call of List +func (mr *MockActionVersionAPIMockRecorder) List(actionID interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{actionID}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockActionVersionAPI)(nil).List), varargs...) +} + +// Test mocks base method +func (m *MockActionVersionAPI) Test(actionID, id string, payload management.Object) (management.Object, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Test", actionID, id, payload) + ret0, _ := ret[0].(management.Object) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Test indicates an expected call of Test +func (mr *MockActionVersionAPIMockRecorder) Test(actionID, id, payload interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Test", reflect.TypeOf((*MockActionVersionAPI)(nil).Test), actionID, id, payload) +} + +// Deploy mocks base method +func (m *MockActionVersionAPI) Deploy(actionID, id string) (*management.ActionVersion, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Deploy", actionID, id) + ret0, _ := ret[0].(*management.ActionVersion) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Deploy indicates an expected call of Deploy +func (mr *MockActionVersionAPIMockRecorder) Deploy(actionID, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Deploy", reflect.TypeOf((*MockActionVersionAPI)(nil).Deploy), actionID, id) +} + +// MockActionBindingAPI is a mock of ActionBindingAPI interface +type MockActionBindingAPI struct { + ctrl *gomock.Controller + recorder *MockActionBindingAPIMockRecorder +} + +// MockActionBindingAPIMockRecorder is the mock recorder for MockActionBindingAPI +type MockActionBindingAPIMockRecorder struct { + mock *MockActionBindingAPI +} + +// NewMockActionBindingAPI creates a new mock instance +func NewMockActionBindingAPI(ctrl *gomock.Controller) *MockActionBindingAPI { + mock := &MockActionBindingAPI{ctrl: ctrl} + mock.recorder = &MockActionBindingAPIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockActionBindingAPI) EXPECT() *MockActionBindingAPIMockRecorder { + return m.recorder +} + +// Create mocks base method +func (m *MockActionBindingAPI) Create(triggerID management.TriggerID, action *management.Action) (*management.ActionBinding, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Create", triggerID, action) + ret0, _ := ret[0].(*management.ActionBinding) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Create indicates an expected call of Create +func (mr *MockActionBindingAPIMockRecorder) Create(triggerID, action interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockActionBindingAPI)(nil).Create), triggerID, action) +} + +// List mocks base method +func (m *MockActionBindingAPI) List(triggerID management.TriggerID, opts ...management.RequestOption) (*management.ActionBindingList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{triggerID} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].(*management.ActionBindingList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// List indicates an expected call of List +func (mr *MockActionBindingAPIMockRecorder) List(triggerID interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{triggerID}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockActionBindingAPI)(nil).List), varargs...) +} + +// Update mocks base method +func (m *MockActionBindingAPI) Update(triggerID management.TriggerID, v []*management.ActionBinding) (*management.ActionBindingList, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Update", triggerID, v) + ret0, _ := ret[0].(*management.ActionBindingList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Update indicates an expected call of Update +func (mr *MockActionBindingAPIMockRecorder) Update(triggerID, v interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockActionBindingAPI)(nil).Update), triggerID, v) +} + +// MockActionExecutionAPI is a mock of ActionExecutionAPI interface +type MockActionExecutionAPI struct { + ctrl *gomock.Controller + recorder *MockActionExecutionAPIMockRecorder +} + +// MockActionExecutionAPIMockRecorder is the mock recorder for MockActionExecutionAPI +type MockActionExecutionAPIMockRecorder struct { + mock *MockActionExecutionAPI +} + +// NewMockActionExecutionAPI creates a new mock instance +func NewMockActionExecutionAPI(ctrl *gomock.Controller) *MockActionExecutionAPI { + mock := &MockActionExecutionAPI{ctrl: ctrl} + mock.recorder = &MockActionExecutionAPIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockActionExecutionAPI) EXPECT() *MockActionExecutionAPIMockRecorder { + return m.recorder +} + +// Read mocks base method +func (m *MockActionExecutionAPI) Read(id string) (*management.ActionExecution, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Read", id) + ret0, _ := ret[0].(*management.ActionExecution) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Read indicates an expected call of Read +func (mr *MockActionExecutionAPIMockRecorder) Read(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Read", reflect.TypeOf((*MockActionExecutionAPI)(nil).Read), id) }