2023-03-16 07:25:01 +03:00
|
|
|
package vault
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2023-05-05 20:10:01 +03:00
|
|
|
"go.unistack.org/micro/v4/codec"
|
|
|
|
"go.unistack.org/micro/v4/config"
|
2023-08-15 07:47:34 +03:00
|
|
|
"go.unistack.org/micro/v4/options"
|
2023-03-16 07:25:01 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestInit(t *testing.T) {
|
|
|
|
c := NewConfig(
|
2023-08-15 07:47:34 +03:00
|
|
|
options.Context(context.TODO()),
|
|
|
|
options.Codec(codec.NewCodec()),
|
2023-03-16 07:25:01 +03:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|