update uuid.Nil reference for special placeholder reference.

This commit is contained in:
Jason Kulatunga 2023-10-17 20:25:23 -07:00
parent 9327464e38
commit 145eea6d6a
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -573,7 +573,7 @@ func (gr *GormRepository) AddResourceComposition(ctx context.Context, compositio
}
//generate placeholder source
placeholderSource := models.SourceCredential{UserID: currentUser.ID, SourceType: "manual", ModelBase: models.ModelBase{ID: uuid.MustParse("00000000-0000-0000-0000-000000000000")}}
placeholderSource := models.SourceCredential{UserID: currentUser.ID, SourceType: "manual", ModelBase: models.ModelBase{ID: uuid.Nil}}
existingCompositionResources := []*models.ResourceBase{}
rawResourceLookupTable := map[string]*models.ResourceBase{}

View File

@ -1190,7 +1190,7 @@ func (suite *RepositoryTestSuite) TestAddResourceComposition_WithExistingComposi
//assert that the associations were created
associations, err := dbRepo.FindResourceAssociationsByTypeAndId(authContext,
&models.SourceCredential{UserID: userModel.ID, ModelBase: models.ModelBase{ID: uuid.MustParse("00000000-0000-0000-0000-000000000000")}}, //Compositions have a unique/placeholder credential ID
&models.SourceCredential{UserID: userModel.ID, ModelBase: models.ModelBase{ID: uuid.Nil}}, //Compositions have a unique/placeholder credential ID
"Composition", compositions[0].SourceResourceID)
require.NoError(suite.T(), err)
require.Equal(suite.T(), 5, len(associations))