Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon committed Nov 25, 2024
1 parent 630bee6 commit 6b6b870
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/provider/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ func (s *ServiceTestSuite) TestCreate() {
s.mockProviderRepository.EXPECT().Create(mockCtx, p).Return(nil).Once()
s.mockAuditLogger.On("Log", mock.Anything, provider.AuditKeyCreate, mock.Anything).Return(nil).Once()

expectedResources := []*domain.Resource{}
s.mockResourceService.On("Find", mock.Anything, domain.ListResourcesFilter{
ProviderType: p.Type,
ProviderURN: p.URN,
}).Return([]*domain.Resource{}, nil).Once()
s.mockProvider.On("GetResources", mockCtx, p.Config).Return([]*domain.Resource{}, nil).Once()
s.mockResourceService.On("BulkUpsert", mock.Anything, []*domain.Resource{}).Return(nil).Once()
s.mockProvider.On("GetResources", mockCtx, p.Config).Return(expectedResources, nil).Once()
s.mockResourceService.On("BulkUpsert", mock.Anything, []*domain.Resource(nil)).Return(nil).Once()

actualError := s.service.Create(context.Background(), p)

Expand Down

0 comments on commit 6b6b870

Please sign in to comment.