mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
f77ec5644a
CI / checkproto (push) Has been cancelled
CI / lint (push) Has been cancelled
Rust CI Pipeline / rust-check (push) Has been cancelled
CI / test (agent) (push) Has been cancelled
CI / test (cli) (push) Has been cancelled
CI / test (cmd) (push) Has been cancelled
CI / test (internal) (push) Has been cancelled
CI / test (manager, true) (push) Has been cancelled
CI / test (pkg) (push) Has been cancelled
CI / upload-coverage (push) Has been cancelled
* feat: Add Confidential Containers attestation agent as an alternative attestation backend with new proto definitions and build system integration. Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix: Update protoc-gen-go and protoc-gen-go-grpc versions in CI workflow Signed-off-by: Sammy Oina <sammyoina@gmail.com> * feat: Add mock implementation for AttestationAgentServiceClient and corresponding tests Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix: Add missing periods to test function comments in provider_test.go Signed-off-by: Sammy Oina <sammyoina@gmail.com> --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com>
566 lines
21 KiB
Go
566 lines
21 KiB
Go
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
"github.com/ultravioletrs/cocos/internal/proto/attestation-agent"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
// NewAttestationAgentServiceClient creates a new instance of AttestationAgentServiceClient. 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 NewAttestationAgentServiceClient(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *AttestationAgentServiceClient {
|
|
mock := &AttestationAgentServiceClient{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// AttestationAgentServiceClient is an autogenerated mock type for the AttestationAgentServiceClient type
|
|
type AttestationAgentServiceClient struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type AttestationAgentServiceClient_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *AttestationAgentServiceClient) EXPECT() *AttestationAgentServiceClient_Expecter {
|
|
return &AttestationAgentServiceClient_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// BindInitData provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) BindInitData(ctx context.Context, in *attestation_agent.BindInitDataRequest, opts ...grpc.CallOption) (*attestation_agent.BindInitDataResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for BindInitData")
|
|
}
|
|
|
|
var r0 *attestation_agent.BindInitDataResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.BindInitDataRequest, ...grpc.CallOption) (*attestation_agent.BindInitDataResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.BindInitDataRequest, ...grpc.CallOption) *attestation_agent.BindInitDataResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.BindInitDataResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.BindInitDataRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_BindInitData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BindInitData'
|
|
type AttestationAgentServiceClient_BindInitData_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// BindInitData is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.BindInitDataRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) BindInitData(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_BindInitData_Call {
|
|
return &AttestationAgentServiceClient_BindInitData_Call{Call: _e.mock.On("BindInitData",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_BindInitData_Call) Run(run func(ctx context.Context, in *attestation_agent.BindInitDataRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_BindInitData_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.BindInitDataRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.BindInitDataRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_BindInitData_Call) Return(bindInitDataResponse *attestation_agent.BindInitDataResponse, err error) *AttestationAgentServiceClient_BindInitData_Call {
|
|
_c.Call.Return(bindInitDataResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_BindInitData_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.BindInitDataRequest, opts ...grpc.CallOption) (*attestation_agent.BindInitDataResponse, error)) *AttestationAgentServiceClient_BindInitData_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ExtendRuntimeMeasurement provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) ExtendRuntimeMeasurement(ctx context.Context, in *attestation_agent.ExtendRuntimeMeasurementRequest, opts ...grpc.CallOption) (*attestation_agent.ExtendRuntimeMeasurementResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ExtendRuntimeMeasurement")
|
|
}
|
|
|
|
var r0 *attestation_agent.ExtendRuntimeMeasurementResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.ExtendRuntimeMeasurementRequest, ...grpc.CallOption) (*attestation_agent.ExtendRuntimeMeasurementResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.ExtendRuntimeMeasurementRequest, ...grpc.CallOption) *attestation_agent.ExtendRuntimeMeasurementResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.ExtendRuntimeMeasurementResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.ExtendRuntimeMeasurementRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendRuntimeMeasurement'
|
|
type AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ExtendRuntimeMeasurement is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.ExtendRuntimeMeasurementRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) ExtendRuntimeMeasurement(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call {
|
|
return &AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call{Call: _e.mock.On("ExtendRuntimeMeasurement",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call) Run(run func(ctx context.Context, in *attestation_agent.ExtendRuntimeMeasurementRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.ExtendRuntimeMeasurementRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.ExtendRuntimeMeasurementRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call) Return(extendRuntimeMeasurementResponse *attestation_agent.ExtendRuntimeMeasurementResponse, err error) *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call {
|
|
_c.Call.Return(extendRuntimeMeasurementResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.ExtendRuntimeMeasurementRequest, opts ...grpc.CallOption) (*attestation_agent.ExtendRuntimeMeasurementResponse, error)) *AttestationAgentServiceClient_ExtendRuntimeMeasurement_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetAdditionalEvidence provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) GetAdditionalEvidence(ctx context.Context, in *attestation_agent.GetAdditionalEvidenceRequest, opts ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAdditionalEvidence")
|
|
}
|
|
|
|
var r0 *attestation_agent.GetEvidenceResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetAdditionalEvidenceRequest, ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetAdditionalEvidenceRequest, ...grpc.CallOption) *attestation_agent.GetEvidenceResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.GetEvidenceResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.GetAdditionalEvidenceRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_GetAdditionalEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAdditionalEvidence'
|
|
type AttestationAgentServiceClient_GetAdditionalEvidence_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetAdditionalEvidence is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.GetAdditionalEvidenceRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) GetAdditionalEvidence(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_GetAdditionalEvidence_Call {
|
|
return &AttestationAgentServiceClient_GetAdditionalEvidence_Call{Call: _e.mock.On("GetAdditionalEvidence",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetAdditionalEvidence_Call) Run(run func(ctx context.Context, in *attestation_agent.GetAdditionalEvidenceRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_GetAdditionalEvidence_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.GetAdditionalEvidenceRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.GetAdditionalEvidenceRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetAdditionalEvidence_Call) Return(getEvidenceResponse *attestation_agent.GetEvidenceResponse, err error) *AttestationAgentServiceClient_GetAdditionalEvidence_Call {
|
|
_c.Call.Return(getEvidenceResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetAdditionalEvidence_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.GetAdditionalEvidenceRequest, opts ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error)) *AttestationAgentServiceClient_GetAdditionalEvidence_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetEvidence provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) GetEvidence(ctx context.Context, in *attestation_agent.GetEvidenceRequest, opts ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetEvidence")
|
|
}
|
|
|
|
var r0 *attestation_agent.GetEvidenceResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetEvidenceRequest, ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetEvidenceRequest, ...grpc.CallOption) *attestation_agent.GetEvidenceResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.GetEvidenceResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.GetEvidenceRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_GetEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEvidence'
|
|
type AttestationAgentServiceClient_GetEvidence_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetEvidence is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.GetEvidenceRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) GetEvidence(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_GetEvidence_Call {
|
|
return &AttestationAgentServiceClient_GetEvidence_Call{Call: _e.mock.On("GetEvidence",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetEvidence_Call) Run(run func(ctx context.Context, in *attestation_agent.GetEvidenceRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_GetEvidence_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.GetEvidenceRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.GetEvidenceRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetEvidence_Call) Return(getEvidenceResponse *attestation_agent.GetEvidenceResponse, err error) *AttestationAgentServiceClient_GetEvidence_Call {
|
|
_c.Call.Return(getEvidenceResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetEvidence_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.GetEvidenceRequest, opts ...grpc.CallOption) (*attestation_agent.GetEvidenceResponse, error)) *AttestationAgentServiceClient_GetEvidence_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetTeeType provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) GetTeeType(ctx context.Context, in *attestation_agent.GetTeeTypeRequest, opts ...grpc.CallOption) (*attestation_agent.GetTeeTypeResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetTeeType")
|
|
}
|
|
|
|
var r0 *attestation_agent.GetTeeTypeResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetTeeTypeRequest, ...grpc.CallOption) (*attestation_agent.GetTeeTypeResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetTeeTypeRequest, ...grpc.CallOption) *attestation_agent.GetTeeTypeResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.GetTeeTypeResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.GetTeeTypeRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_GetTeeType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTeeType'
|
|
type AttestationAgentServiceClient_GetTeeType_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetTeeType is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.GetTeeTypeRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) GetTeeType(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_GetTeeType_Call {
|
|
return &AttestationAgentServiceClient_GetTeeType_Call{Call: _e.mock.On("GetTeeType",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetTeeType_Call) Run(run func(ctx context.Context, in *attestation_agent.GetTeeTypeRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_GetTeeType_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.GetTeeTypeRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.GetTeeTypeRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetTeeType_Call) Return(getTeeTypeResponse *attestation_agent.GetTeeTypeResponse, err error) *AttestationAgentServiceClient_GetTeeType_Call {
|
|
_c.Call.Return(getTeeTypeResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetTeeType_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.GetTeeTypeRequest, opts ...grpc.CallOption) (*attestation_agent.GetTeeTypeResponse, error)) *AttestationAgentServiceClient_GetTeeType_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetToken provides a mock function for the type AttestationAgentServiceClient
|
|
func (_mock *AttestationAgentServiceClient) GetToken(ctx context.Context, in *attestation_agent.GetTokenRequest, opts ...grpc.CallOption) (*attestation_agent.GetTokenResponse, error) {
|
|
// grpc.CallOption
|
|
_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 := _mock.Called(_ca...)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetToken")
|
|
}
|
|
|
|
var r0 *attestation_agent.GetTokenResponse
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetTokenRequest, ...grpc.CallOption) (*attestation_agent.GetTokenResponse, error)); ok {
|
|
return returnFunc(ctx, in, opts...)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, *attestation_agent.GetTokenRequest, ...grpc.CallOption) *attestation_agent.GetTokenResponse); ok {
|
|
r0 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*attestation_agent.GetTokenResponse)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, *attestation_agent.GetTokenRequest, ...grpc.CallOption) error); ok {
|
|
r1 = returnFunc(ctx, in, opts...)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// AttestationAgentServiceClient_GetToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetToken'
|
|
type AttestationAgentServiceClient_GetToken_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetToken is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - in *attestation_agent.GetTokenRequest
|
|
// - opts ...grpc.CallOption
|
|
func (_e *AttestationAgentServiceClient_Expecter) GetToken(ctx interface{}, in interface{}, opts ...interface{}) *AttestationAgentServiceClient_GetToken_Call {
|
|
return &AttestationAgentServiceClient_GetToken_Call{Call: _e.mock.On("GetToken",
|
|
append([]interface{}{ctx, in}, opts...)...)}
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetToken_Call) Run(run func(ctx context.Context, in *attestation_agent.GetTokenRequest, opts ...grpc.CallOption)) *AttestationAgentServiceClient_GetToken_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 *attestation_agent.GetTokenRequest
|
|
if args[1] != nil {
|
|
arg1 = args[1].(*attestation_agent.GetTokenRequest)
|
|
}
|
|
var arg2 []grpc.CallOption
|
|
variadicArgs := make([]grpc.CallOption, len(args)-2)
|
|
for i, a := range args[2:] {
|
|
if a != nil {
|
|
variadicArgs[i] = a.(grpc.CallOption)
|
|
}
|
|
}
|
|
arg2 = variadicArgs
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2...,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetToken_Call) Return(getTokenResponse *attestation_agent.GetTokenResponse, err error) *AttestationAgentServiceClient_GetToken_Call {
|
|
_c.Call.Return(getTokenResponse, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AttestationAgentServiceClient_GetToken_Call) RunAndReturn(run func(ctx context.Context, in *attestation_agent.GetTokenRequest, opts ...grpc.CallOption) (*attestation_agent.GetTokenResponse, error)) *AttestationAgentServiceClient_GetToken_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|