1 Star 0 Fork 0

BUPT-ZKJC / fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mocks.go 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
MJL 提交于 2021-08-06 18:37 . first commit
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package mocks
import (
"testing"
"github.com/hyperledger/fabric-protos-go/common"
"gitee.com/bupt-zkjc/fabric/core/ledger"
"github.com/stretchr/testify/mock"
)
type MockACLProvider struct {
//create a mock object that can be reset after
//registering a MockACLProvider with aclmgmt
mock *mock.Mock
}
//clear the mock so we can start afresh
func (m *MockACLProvider) Reset() {
m.mock = &mock.Mock{}
}
func (m *MockACLProvider) CheckACL(resName string, channelID string, idinfo interface{}) error {
args := m.mock.Called(resName, channelID, idinfo)
return args.Error(0)
}
func (m *MockACLProvider) GenerateSimulationResults(txEnvelop *common.Envelope, simulator ledger.TxSimulator, initializingLedger bool) error {
return nil
}
//On overrider the mock method for convenience
func (m *MockACLProvider) On(methodName string, arguments ...interface{}) *mock.Call {
return m.mock.On(methodName, arguments...)
}
//AssertExpectations overrider the mock method for convenience
func (m *MockACLProvider) AssertExpectations(t *testing.T) {
m.mock.AssertExpectations(t)
}
1
https://gitee.com/bupt-zkjc/fabric.git
git@gitee.com:bupt-zkjc/fabric.git
bupt-zkjc
fabric
fabric
98d302355562

搜索帮助