Skip to content

Commit

Permalink
[FAB-8809] Remove redundant test in localconfig
Browse files Browse the repository at this point in the history
Testing for default config values is already performed in
`TestSystemChannel`.

Change-Id: I68b812819ccae72789ff9eb2a300bfe80fac9173
Signed-off-by: Kostas Christidis <kostas@christidis.io>
  • Loading branch information
kchristidis committed Mar 26, 2018
1 parent df2cdd7 commit f332cae
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions orderer/common/localconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ func TestEnvInnerVar(t *testing.T) {
assert.Equal(t, config.Kafka.Retry.ShortInterval, v2, "Environmental override of inner config test 2 did not work")
}

const DummyPath = "/dummy/path"

func TestKafkaTLSConfig(t *testing.T) {
testCases := []struct {
name string
Expand All @@ -115,21 +113,16 @@ func TestKafkaTLSConfig(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
uconf := &TopLevel{Kafka: Kafka{TLS: tc.tls}}
if tc.shouldPanic {
assert.Panics(t, func() { uconf.completeInitialization(DummyPath) }, "should panic")
assert.Panics(t, func() { uconf.completeInitialization("/dummy/path") }, "Should panic")
} else {
assert.NotPanics(t, func() { uconf.completeInitialization(DummyPath) }, "should not panic")
assert.NotPanics(t, func() { uconf.completeInitialization("/dummy/path") }, "Should not panic")
}
})
}
}

func TestSystemChannel(t *testing.T) {
conf, _ := Load()
assert.Equal(t, genesisconfig.TestChainID, conf.General.SystemChannel, "System channel ID should be '%s' by default", genesisconfig.TestChainID)
}

func TestProfileConfig(t *testing.T) {
uconf := &TopLevel{General: General{Profile: Profile{Enabled: true}}}
uconf.completeInitialization(DummyPath)
assert.Equal(t, defaults.General.Profile.Address, uconf.General.Profile.Address, "Expected profile address to be filled with default value")
assert.Equal(t, genesisconfig.TestChainID, conf.General.SystemChannel,
"Expected default system channel ID to be '%s', got '%s' instead", genesisconfig.TestChainID, conf.General.SystemChannel)
}

0 comments on commit f332cae

Please sign in to comment.