Skip to content

Commit

Permalink
fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 20, 2023
1 parent c8718b2 commit cce4a25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/pkg/web/handler/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type SourceHandlerTestSuite struct {

AppConfig *mock_config.MockInterface
AppRepository database.DatabaseRepository
AppEventBus event_bus.Interface
}

// BeforeTest has a function to be executed right before the test starts and receives the suite and test names as input
Expand All @@ -56,6 +57,8 @@ func (suite *SourceHandlerTestSuite) BeforeTest(suiteName, testName string) {
appRepo, err := database.NewRepository(suite.AppConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
suite.AppRepository = appRepo

suite.AppEventBus = event_bus.NewNoopEventBusServer()

appRepo.CreateUser(context.Background(), &models.User{
Username: "test_username",
Password: "test",
Expand All @@ -82,6 +85,7 @@ func (suite *SourceHandlerTestSuite) TestCreateManualSourceHandler() {
ctx.Set(pkg.ContextKeyTypeLogger, logrus.WithField("test", suite.T().Name()))
ctx.Set(pkg.ContextKeyTypeDatabase, suite.AppRepository)
ctx.Set(pkg.ContextKeyTypeConfig, suite.AppConfig)
ctx.Set(pkg.ContextKeyTypeEventBusServer, suite.AppEventBus)
ctx.Set(pkg.ContextKeyTypeAuthUsername, "test_username")

//test
Expand Down

0 comments on commit cce4a25

Please # to comment.