Skip to content

Commit

Permalink
feat:add middleware auth unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
geebytes committed May 27, 2024
1 parent f9e3d14 commit 88f8b6d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestConfig(t *testing.T) {
c.So(config.GetPlugins(), c.ShouldNotBeEmpty)
ss, err := config.GetRPCPlugins()
c.So(err, c.ShouldBeNil)
c.So(ss, c.ShouldNotBeEmpty)
c.So(len(ss), c.ShouldBeGreaterThan, 0)
c.So(config.GetEndpointsPrefix(), c.ShouldNotBeEmpty)
c.So(config.GetGatewayDescriptionOut(), c.ShouldNotBeEmpty)
c.So(config.GetAdminAPIKey(), c.ShouldNotBeEmpty)
Expand All @@ -84,13 +84,13 @@ func TestConfig(t *testing.T) {
c.So(config.GetRSAPriKey(), c.ShouldNotBeEmpty)
c.So(config.GetRSAPubKey(), c.ShouldNotBeEmpty)
c.So(config.GetAppPrefix(), c.ShouldNotBeEmpty)
patch:=gomonkey.ApplyFuncReturn((*viper.Viper).UnmarshalKey,fmt.Errorf("error"))
patch := gomonkey.ApplyFuncReturn((*viper.Viper).UnmarshalKey, fmt.Errorf("error"))
defer patch.Reset()
ss, err = config.GetRPCPlugins()
c.So(err, c.ShouldNotBeNil)
c.So(ss, c.ShouldBeNil)
cnf = conf.ReadConfig("dev")
config2:=cfg.NewConfig(cnf)
config2 := cfg.NewConfig(cnf)
c.So(config2.GetEndpointsPrefix(), c.ShouldNotBeEmpty)
c.So(config2.GetAppKeyPrefix(), c.ShouldNotBeEmpty)
c.So(config2.GetRSAPriKey(), c.ShouldNotBeEmpty)
Expand Down

0 comments on commit 88f8b6d

Please sign in to comment.