Skip to content

Commit

Permalink
Merge "FAB-10331 Fix mockery mock generation"
Browse files Browse the repository at this point in the history
  • Loading branch information
yacovm authored and Gerrit Code Review committed May 23, 2018
2 parents e9c51c1 + 003a6ef commit 342fa4b
Show file tree
Hide file tree
Showing 28 changed files with 21 additions and 349 deletions.
8 changes: 4 additions & 4 deletions core/cclifecycle/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ type LifeCycleChangeListener interface {
// HandleMetadataUpdate is triggered upon a change in the chaincode lifecycle change
type HandleMetadataUpdate func(channel string, chaincodes chaincode.MetadataSet)

// go:generate mockery -dir core/cclifecycle -name LifeCycleChangeListener -case underscore -output core/cclifecycle/mocks/
//go:generate mockery -dir . -name LifeCycleChangeListener -case underscore -output mocks/

// LifeCycleChangeListener runs whenever there is a change to the metadata
// // of a chaincode in the context of a specific channel
func (mdUpdate HandleMetadataUpdate) LifeCycleChangeListener(channel string, chaincodes chaincode.MetadataSet) {
mdUpdate(channel, chaincodes)
}

// go:generate mockery -dir core/cclifecycle -name Enumerator -case underscore -output core/cclifecycle/mocks/
//go:generate mockery -dir . -name Enumerator -case underscore -output mocks/

// Enumerator enumerates chaincodes
type Enumerator interface {
Expand All @@ -63,7 +63,7 @@ func (listCCs Enumerate) Enumerate() ([]chaincode.InstalledChaincode, error) {
return listCCs()
}

// go:generate mockery -dir core/cclifecycle -name Query -case underscore -output core/cclifecycle/mocks/
//go:generate mockery -dir . -name Query -case underscore -output mocks/

// Query queries the state
type Query interface {
Expand All @@ -74,7 +74,7 @@ type Query interface {
Done()
}

// go:generate mockery -dir core/cclifecycle -name QueryCreator -case underscore -output core/cclifecycle/mocks/
//go:generate mockery -dir . -name QueryCreator -case underscore -output mocks/

// QueryCreator creates queries
type QueryCreator interface {
Expand Down
6 changes: 0 additions & 6 deletions core/cclifecycle/mocks/enumerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/cclifecycle/mocks/life_cycle_change_listener.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/cclifecycle/mocks/query.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/cclifecycle/mocks/query_creator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/capabilities.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/identity_deserializer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/plugin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/plugin_factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/plugin_mapper.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions core/committer/txvalidator/mocks/query_executor_creator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions core/committer/txvalidator/plugin_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ func (m MapBasedPluginMapper) PluginFactoryByName(name PluginName) validation.Pl
return m[string(name)]
}

// go:generate mockery -dir core/committer/txvalidator/ -name PluginMapper -case underscore -output core/committer/txvalidator/mocks
// go:generate mockery -dir core/handlers/validation/api/ -name PluginFactory -case underscore -output core/committer/txvalidator/mocks/
// go:generate mockery -dir core/handlers/validation/api/ -name Plugin -case underscore -output core/committer/txvalidator/mocks/
//go:generate mockery -dir . -name PluginMapper -case underscore -output mocks/
//go:generate mockery -dir ../../handlers/validation/api/ -name PluginFactory -case underscore -output mocks/
//go:generate mockery -dir ../../handlers/validation/api/ -name Plugin -case underscore -output mocks/

// PluginMapper maps plugin names to their corresponding factory instance.
// Returns nil if the name isn't associated to any plugin.
type PluginMapper interface {
PluginFactoryByName(name PluginName) validation.PluginFactory
}

// go:generate mockery -dir core/committer/txvalidator/ -name QueryExecutorCreator -case underscore -output core/committer/txvalidator/mocks
//go:generate mockery -dir . -name QueryExecutorCreator -case underscore -output mocks/

// QueryExecutorCreator creates new query executors
type QueryExecutorCreator interface {
Expand Down Expand Up @@ -75,8 +75,8 @@ type PluginValidator struct {
capabilities Capabilities
}

// go:generate mockery -dir core/handlers/validation/api/capabilities/ -name Capabilities -case underscore -output core/committer/txvalidator/mocks/
// go:generate mockery -dir msp/ -name IdentityDeserializer -case underscore -output core/committer/txvalidator/mocks
//go:generate mockery -dir ../../handlers/validation/api/capabilities/ -name Capabilities -case underscore -output mocks/
//go:generate mockery -dir ../../../msp/ -name IdentityDeserializer -case underscore -output mocks/

// NewPluginValidator creates a new PluginValidator
func NewPluginValidator(pm PluginMapper, qec QueryExecutorCreator, deserializer msp.IdentityDeserializer, capabilities Capabilities) *PluginValidator {
Expand Down
Loading

0 comments on commit 342fa4b

Please sign in to comment.