micro-config-vault/vault_test.go
Vasiliy Tolstov 1603add6e6 add before Init func support
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2023-03-16 07:25:01 +03:00

24 lines
424 B
Go

package vault
import (
"context"
"testing"
"go.unistack.org/micro/v3/codec"
"go.unistack.org/micro/v3/config"
)
func TestInit(t *testing.T) {
c := NewConfig(
config.Context(context.TODO()),
config.Codec(codec.NewCodec()),
config.BeforeInit(func(ctx context.Context, c config.Config) error {
return c.Init(Token("tkn"), config.BeforeInit(nil))
}),
)
if err := c.Init(); err != nil {
t.Fatal(err)
}
}