Files
odo/pkg/init/mock.go
Philippe Martin ff03b8e49a Select and pull a devfile using Alizer (#5464)
* Add alizer library and test functionality

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Developer-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/PR-Review

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Contributing-to-Docs
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->

/kind feature

**What does this PR do / why we need it:**

Adds the alizer library from
https://github.com/redhat-developer/alizer/tree/main/go as part of our
implementaion of `odo dev` and `odo init`.

This builds upon @feloy 's PR located here: https://github.com/redhat-developer/odo/pull/5434

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes #

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

N/A. Only function implementation

* New alizer version

* Use alizer for odo init

* Add integration tests

* Add Alizer to odo deploy

* review

* Ask component name for odo deploy

* Fix unit test

Co-authored-by: Charlie Drage <charlie@charliedrage.com>
2022-02-23 01:52:51 -05:00

126 lines
4.8 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: pkg/init/interface.go
// Package init is a generated GoMock package.
package init
import (
reflect "reflect"
v1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
parser "github.com/devfile/library/pkg/devfile/parser"
gomock "github.com/golang/mock/gomock"
backend "github.com/redhat-developer/odo/pkg/init/backend"
filesystem "github.com/redhat-developer/odo/pkg/testingutil/filesystem"
)
// MockClient is a mock of Client interface.
type MockClient struct {
ctrl *gomock.Controller
recorder *MockClientMockRecorder
}
// MockClientMockRecorder is the mock recorder for MockClient.
type MockClientMockRecorder struct {
mock *MockClient
}
// NewMockClient creates a new mock instance.
func NewMockClient(ctrl *gomock.Controller) *MockClient {
mock := &MockClient{ctrl: ctrl}
mock.recorder = &MockClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockClient) EXPECT() *MockClientMockRecorder {
return m.recorder
}
// DownloadDevfile mocks base method.
func (m *MockClient) DownloadDevfile(devfileLocation *backend.DevfileLocation, destDir string) (string, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DownloadDevfile", devfileLocation, destDir)
ret0, _ := ret[0].(string)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// DownloadDevfile indicates an expected call of DownloadDevfile.
func (mr *MockClientMockRecorder) DownloadDevfile(devfileLocation, destDir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadDevfile", reflect.TypeOf((*MockClient)(nil).DownloadDevfile), devfileLocation, destDir)
}
// DownloadStarterProject mocks base method.
func (m *MockClient) DownloadStarterProject(project *v1alpha2.StarterProject, dest string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "DownloadStarterProject", project, dest)
ret0, _ := ret[0].(error)
return ret0
}
// DownloadStarterProject indicates an expected call of DownloadStarterProject.
func (mr *MockClientMockRecorder) DownloadStarterProject(project, dest interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DownloadStarterProject", reflect.TypeOf((*MockClient)(nil).DownloadStarterProject), project, dest)
}
// PersonalizeName mocks base method.
func (m *MockClient) PersonalizeName(devfile parser.DevfileObj, flags map[string]string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "PersonalizeName", devfile, flags)
ret0, _ := ret[0].(error)
return ret0
}
// PersonalizeName indicates an expected call of PersonalizeName.
func (mr *MockClientMockRecorder) PersonalizeName(devfile, flags interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PersonalizeName", reflect.TypeOf((*MockClient)(nil).PersonalizeName), devfile, flags)
}
// SelectDevfile mocks base method.
func (m *MockClient) SelectDevfile(flags map[string]string, fs filesystem.Filesystem, dir string) (*backend.DevfileLocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SelectDevfile", flags, fs, dir)
ret0, _ := ret[0].(*backend.DevfileLocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SelectDevfile indicates an expected call of SelectDevfile.
func (mr *MockClientMockRecorder) SelectDevfile(flags, fs, dir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectDevfile", reflect.TypeOf((*MockClient)(nil).SelectDevfile), flags, fs, dir)
}
// SelectStarterProject mocks base method.
func (m *MockClient) SelectStarterProject(devfile parser.DevfileObj, flags map[string]string, fs filesystem.Filesystem, dir string) (*v1alpha2.StarterProject, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SelectStarterProject", devfile, flags, fs, dir)
ret0, _ := ret[0].(*v1alpha2.StarterProject)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SelectStarterProject indicates an expected call of SelectStarterProject.
func (mr *MockClientMockRecorder) SelectStarterProject(devfile, flags, fs, dir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectStarterProject", reflect.TypeOf((*MockClient)(nil).SelectStarterProject), devfile, flags, fs, dir)
}
// Validate mocks base method.
func (m *MockClient) Validate(flags map[string]string, fs filesystem.Filesystem, dir string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Validate", flags, fs, dir)
ret0, _ := ret[0].(error)
return ret0
}
// Validate indicates an expected call of Validate.
func (mr *MockClientMockRecorder) Validate(flags, fs, dir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockClient)(nil).Validate), flags, fs, dir)
}