forked from p53841790/wheat-cache
feat(conf): updata conf test
This commit is contained in:
parent
4d9558c21f
commit
febd5501c4
|
@ -1,7 +1,6 @@
|
||||||
package conf
|
package conf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -26,18 +25,11 @@ func TestConf(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMiddleConf(t *testing.T) {
|
func TestMiddleConf(t *testing.T) {
|
||||||
ct := viper.GetStringMap("plugins-control")
|
ct := viper.GetStringSlice("plugins-control.logcontext")
|
||||||
|
require.Equal(t, ct, []string{"logMiddle"})
|
||||||
fmt.Println(ct)
|
|
||||||
|
|
||||||
d := viper.GetInt("middleware-driver.driverCount")
|
d := viper.GetInt("middleware-driver.driverCount")
|
||||||
require.Equal(t, d, 1000)
|
require.Equal(t, d, 1000)
|
||||||
c := viper.GetInt("middleware-driver.middleConsumerCount")
|
c := viper.GetInt("middleware-driver.middleConsumerCount")
|
||||||
require.Equal(t, c, 5)
|
require.Equal(t, c, 5)
|
||||||
|
|
||||||
p := viper.GetStringMap("plugins-control")
|
|
||||||
for key, val := range p {
|
|
||||||
fmt.Println(key, val)
|
|
||||||
}
|
|
||||||
// fmt.Println(p)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue