Files
odo/pkg/init/backend/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

96 lines
3.6 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: pkg/init/backend/interface.go
// Package backend is a generated GoMock package.
package backend
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"
filesystem "github.com/redhat-developer/odo/pkg/testingutil/filesystem"
)
// MockInitBackend is a mock of InitBackend interface.
type MockInitBackend struct {
ctrl *gomock.Controller
recorder *MockInitBackendMockRecorder
}
// MockInitBackendMockRecorder is the mock recorder for MockInitBackend.
type MockInitBackendMockRecorder struct {
mock *MockInitBackend
}
// NewMockInitBackend creates a new mock instance.
func NewMockInitBackend(ctrl *gomock.Controller) *MockInitBackend {
mock := &MockInitBackend{ctrl: ctrl}
mock.recorder = &MockInitBackendMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockInitBackend) EXPECT() *MockInitBackendMockRecorder {
return m.recorder
}
// PersonalizeName mocks base method.
func (m *MockInitBackend) 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 *MockInitBackendMockRecorder) PersonalizeName(devfile, flags interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PersonalizeName", reflect.TypeOf((*MockInitBackend)(nil).PersonalizeName), devfile, flags)
}
// SelectDevfile mocks base method.
func (m *MockInitBackend) SelectDevfile(flags map[string]string, fs filesystem.Filesystem, dir string) (*DevfileLocation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SelectDevfile", flags, fs, dir)
ret0, _ := ret[0].(*DevfileLocation)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SelectDevfile indicates an expected call of SelectDevfile.
func (mr *MockInitBackendMockRecorder) SelectDevfile(flags, fs, dir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectDevfile", reflect.TypeOf((*MockInitBackend)(nil).SelectDevfile), flags, fs, dir)
}
// SelectStarterProject mocks base method.
func (m *MockInitBackend) SelectStarterProject(devfile parser.DevfileObj, flags map[string]string) (*v1alpha2.StarterProject, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SelectStarterProject", devfile, flags)
ret0, _ := ret[0].(*v1alpha2.StarterProject)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SelectStarterProject indicates an expected call of SelectStarterProject.
func (mr *MockInitBackendMockRecorder) SelectStarterProject(devfile, flags interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectStarterProject", reflect.TypeOf((*MockInitBackend)(nil).SelectStarterProject), devfile, flags)
}
// Validate mocks base method.
func (m *MockInitBackend) 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 *MockInitBackendMockRecorder) Validate(flags, fs, dir interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validate", reflect.TypeOf((*MockInitBackend)(nil).Validate), flags, fs, dir)
}