Skip to content

Commit

Permalink
FABG-890 Fixed argument names
Browse files Browse the repository at this point in the history
Change-Id: I611618aaa74d93a291de5e05e5b4691d3732a827
Signed-off-by: Aleksandar Likic <[email protected]>
  • Loading branch information
Aleksandar Likic committed Aug 8, 2019
1 parent 5679961 commit ba9dfce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions pkg/msp/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ type client interface {

// caConfig interface allows to uniquely override IdentityConfig interface's CAConfig() function
type caConfig interface {
CAConfig(org string) (*msp.CAConfig, bool)
CAConfig(caID string) (*msp.CAConfig, bool)
}

// caServerCerts interface allows to uniquely override IdentityConfig interface's CAServerCerts() function
type caServerCerts interface {
CAServerCerts(org string) ([][]byte, bool)
CAServerCerts(caID string) ([][]byte, bool)
}

// caClientKey interface allows to uniquely override IdentityConfig interface's CAClientKey() function
type caClientKey interface {
CAClientKey(org string) ([]byte, bool)
CAClientKey(caID string) ([]byte, bool)
}

// caClientCert interface allows to uniquely override IdentityConfig interface's CAClientCert() function
type caClientCert interface {
CAClientCert(org string) ([]byte, bool)
CAClientCert(caID string) ([]byte, bool)
}

// caKeyStorePath interface allows to uniquely override IdentityConfig interface's CAKeyStorePath() function
Expand Down
12 changes: 6 additions & 6 deletions pkg/msp/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ func TestCreateCustomIdentityConfig(t *testing.T) {
require.NotEmpty(t, clnt, "client returned must not be empty")

// test m2 implementation
caCfg, ok := ico.CAConfig("testORG")
caCfg, ok := ico.CAConfig("testCA")
require.True(t, ok, "CAConfig failed")
require.Equal(t, "test.url.com", caCfg.URL, "CAConfig did not return expected interface value")

// test m3 implementation
s, ok := ico.CAServerCerts("testORG")
s, ok := ico.CAServerCerts("testCA")
require.True(t, ok, "CAServerCerts failed")
require.Equal(t, []byte("testCAservercert1"), s[0], "CAServerCerts did not return the right cert")
require.Equal(t, []byte("testCAservercert2"), s[1], "CAServerCerts did not return the right cert")

// test m4 implementation
c, ok := ico.CAClientKey("testORG")
c, ok := ico.CAClientKey("testCA")
require.True(t, ok, "CAClientKey failed")
require.Equal(t, []byte("testCAclientkey"), c, "CAClientKey did not return the right cert")

Expand Down Expand Up @@ -148,18 +148,18 @@ func TestCreateCustomIdentityConfigWithSomeDefaultFunctions(t *testing.T) {
require.NotEmpty(t, clnt, "client returned must not be empty")

// test m2 implementation
caCfg, ok := identityConfigOptionWithSomeDefaults.CAConfig("testORG")
caCfg, ok := identityConfigOptionWithSomeDefaults.CAConfig("testCA")
require.True(t, ok, "CAConfig failed")
require.Equal(t, "test.url.com", caCfg.URL, "CAConfig did not return expected interface value")

// test m3 implementation
s, ok := identityConfigOptionWithSomeDefaults.CAServerCerts("testORG")
s, ok := identityConfigOptionWithSomeDefaults.CAServerCerts("testCA")
require.True(t, ok, "CAServerCerts failed")
require.Equal(t, []byte("testCAservercert1"), s[0], "CAServerCerts did not return the right cert")
require.Equal(t, []byte("testCAservercert2"), s[1], "CAServerCerts did not return the right cert")

// test m4 implementation
c, ok := identityConfigOptionWithSomeDefaults.CAClientKey("testORG")
c, ok := identityConfigOptionWithSomeDefaults.CAClientKey("testCA")
require.True(t, ok, "CAClientKey failed")
require.Equal(t, []byte("testCAclientkey"), c, "CAClientKey did not return the right cert")

Expand Down

0 comments on commit ba9dfce

Please sign in to comment.