|
|
@ -74,6 +74,7 @@ func (suite *RepositoryTestSuite) TestNewRepository() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
|
|
|
|
|
|
|
|
//test
|
|
|
|
//test
|
|
|
@ -87,6 +88,7 @@ func (suite *RepositoryTestSuite) TestCreateUser() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -107,6 +109,7 @@ func (suite *RepositoryTestSuite) TestCreateUser_WithExitingUser_ShouldFail() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -135,6 +138,7 @@ func (suite *RepositoryTestSuite) TestCreateUser_WithUserProvidedId_ShouldBeRepl
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -160,6 +164,7 @@ func (suite *RepositoryTestSuite) TestGetUserByUsername() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -183,6 +188,7 @@ func (suite *RepositoryTestSuite) TestGetUserByUsername_WithInvalidUsername() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -205,6 +211,7 @@ func (suite *RepositoryTestSuite) TestGetCurrentUser_WithContextBackgroundAuthUs
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -229,6 +236,7 @@ func (suite *RepositoryTestSuite) TestGetCurrentUser_WithGinContextBackgroundAut
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -257,6 +265,7 @@ func (suite *RepositoryTestSuite) TestGetCurrentUser_WithContextBackgroundAuthUs
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -273,6 +282,7 @@ func (suite *RepositoryTestSuite) TestCreateGlossaryEntry() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -308,6 +318,7 @@ func (suite *RepositoryTestSuite) TestUpsertRawResource() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -364,6 +375,7 @@ func (suite *RepositoryTestSuite) TestUpsertRawResource_WithRelatedResourceAndDu
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -411,6 +423,7 @@ func (suite *RepositoryTestSuite) TestListResources() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -513,6 +526,7 @@ func (suite *RepositoryTestSuite) TestGetResourceByResourceTypeAndId() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -566,6 +580,7 @@ func (suite *RepositoryTestSuite) TestGetResourceBySourceId() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -619,6 +634,7 @@ func (suite *RepositoryTestSuite) TestGetPatientForSources() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -675,6 +691,7 @@ func (suite *RepositoryTestSuite) TestAddResourceAssociation() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -711,6 +728,7 @@ func (suite *RepositoryTestSuite) TestAddResourceAssociation_WithMismatchingSour
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -760,6 +778,7 @@ func (suite *RepositoryTestSuite) TestRemoveResourceAssociation() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -801,6 +820,7 @@ func (suite *RepositoryTestSuite) TestGetSourceSummary() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -881,6 +901,7 @@ func (suite *RepositoryTestSuite) TestGetSummary() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -984,6 +1005,7 @@ func (suite *RepositoryTestSuite) TestAddResourceComposition() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -1069,6 +1091,7 @@ func (suite *RepositoryTestSuite) TestAddResourceComposition_WithExistingComposi
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -1229,6 +1252,7 @@ func (suite *RepositoryTestSuite) TestCreateBackgroundJob_Sync() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -1263,6 +1287,7 @@ func (suite *RepositoryTestSuite) TestListBackgroundJobs() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
@ -1339,6 +1364,7 @@ func (suite *RepositoryTestSuite) TestUpdateBackgroundJob() {
|
|
|
|
//setup
|
|
|
|
//setup
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig := mock_config.NewMockInterface(suite.MockCtrl)
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("database.location").Return(suite.TestDatabase.Name()).AnyTimes()
|
|
|
|
|
|
|
|
fakeConfig.EXPECT().GetString("database.type").Return("sqlite").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
fakeConfig.EXPECT().GetString("log.level").Return("INFO").AnyTimes()
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
dbRepo, err := NewRepository(fakeConfig, logrus.WithField("test", suite.T().Name()), event_bus.NewNoopEventBusServer())
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|
require.NoError(suite.T(), err)
|
|
|
|