123 lines
3.8 KiB
Go
123 lines
3.8 KiB
Go
/*
|
|
Copyright The Karmada Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
|
|
|
package service
|
|
|
|
import (
|
|
context "context"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
pb "github.com/karmada-io/karmada/pkg/estimator/pb"
|
|
)
|
|
|
|
// MockEstimatorClient is an autogenerated mock type for the EstimatorClient type
|
|
type MockEstimatorClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// GetUnschedulableReplicas provides a mock function with given fields: ctx, in, opts
|
|
func (_m *MockEstimatorClient) GetUnschedulableReplicas(ctx context.Context, in *pb.UnschedulableReplicasRequest, opts ...grpc.CallOption) (*pb.UnschedulableReplicasResponse, error) {
|
|
_va := make([]interface{}, len(opts))
|
|
for _i := range opts {
|
|
_va[_i] = opts[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, in)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetUnschedulableReplicas")
|
|
}
|
|
|
|
var r0 *pb.UnschedulableReplicasResponse
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pb.UnschedulableReplicasRequest, ...grpc.CallOption) (*pb.UnschedulableReplicasResponse, error)); ok {
|
|
return rf(ctx, in, opts...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pb.UnschedulableReplicasRequest, ...grpc.CallOption) *pb.UnschedulableReplicasResponse); ok {
|
|
r0 = rf(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*pb.UnschedulableReplicasResponse)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *pb.UnschedulableReplicasRequest, ...grpc.CallOption) error); ok {
|
|
r1 = rf(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MaxAvailableReplicas provides a mock function with given fields: ctx, in, opts
|
|
func (_m *MockEstimatorClient) MaxAvailableReplicas(ctx context.Context, in *pb.MaxAvailableReplicasRequest, opts ...grpc.CallOption) (*pb.MaxAvailableReplicasResponse, error) {
|
|
_va := make([]interface{}, len(opts))
|
|
for _i := range opts {
|
|
_va[_i] = opts[_i]
|
|
}
|
|
var _ca []interface{}
|
|
_ca = append(_ca, ctx, in)
|
|
_ca = append(_ca, _va...)
|
|
ret := _m.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for MaxAvailableReplicas")
|
|
}
|
|
|
|
var r0 *pb.MaxAvailableReplicasResponse
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pb.MaxAvailableReplicasRequest, ...grpc.CallOption) (*pb.MaxAvailableReplicasResponse, error)); ok {
|
|
return rf(ctx, in, opts...)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, *pb.MaxAvailableReplicasRequest, ...grpc.CallOption) *pb.MaxAvailableReplicasResponse); ok {
|
|
r0 = rf(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*pb.MaxAvailableReplicasResponse)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, *pb.MaxAvailableReplicasRequest, ...grpc.CallOption) error); ok {
|
|
r1 = rf(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewMockEstimatorClient creates a new instance of MockEstimatorClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewMockEstimatorClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockEstimatorClient {
|
|
mock := &MockEstimatorClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|