Skip to content

Commit

Permalink
Mocked cmd health check (#4)
Browse files Browse the repository at this point in the history
Mocked missed mocking cmd health check after mocking other GET
endpoints.
  • Loading branch information
ice-myles authored Apr 4, 2023
1 parent 45182ba commit 1a642a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
11 changes: 1 addition & 10 deletions cmd/husky/husky.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"github.com/pkg/errors"

"github.com/ice-blockchain/husky/cmd/husky/api"
"github.com/ice-blockchain/husky/news"
"github.com/ice-blockchain/husky/notifications"
appCfg "github.com/ice-blockchain/wintr/config"
"github.com/ice-blockchain/wintr/log"
"github.com/ice-blockchain/wintr/server"
Expand Down Expand Up @@ -50,15 +48,8 @@ func (*service) Close(ctx context.Context) error {
return nil
}

func (s *service) CheckHealth(ctx context.Context) error {
func (*service) CheckHealth(_ context.Context) error {
log.Debug("checking health...", "package", "news")
if _, err := s.newsRepository.GetNews(ctx, news.FeaturedNewsType, "en", 1, 0); err != nil {
return errors.Wrap(err, "failed to get featured news")
}
log.Debug("checking health...", "package", "notifications")
if _, err := s.notificationsRepository.GetNotificationChannelToggles(ctx, notifications.PushNotificationChannel, "bogus"); err != nil {
return errors.Wrap(err, "failed to GetNotificationChannelToggles")
}

return nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ require (
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.6.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down

0 comments on commit 1a642a4

Please sign in to comment.