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