use prevPath in data.Collection (#1943)

## Type of change

- [x] 🐛 Bugfix

## Issue(s)

* #1777

## Test Plan

- [x] 💪 Manual
This commit is contained in:
Keepers 2022-12-23 14:48:37 -07:00 committed by GitHub
parent a1444f529e
commit 73c4937456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -158,7 +158,7 @@ func (col *Collection) FullPath() path.Path {
// TODO(ashmrtn): Fill in with previous path once GraphConnector compares old // TODO(ashmrtn): Fill in with previous path once GraphConnector compares old
// and new folder hierarchies. // and new folder hierarchies.
func (col Collection) PreviousPath() path.Path { func (col Collection) PreviousPath() path.Path {
return nil return col.prevPath
} }
func (col Collection) State() data.CollectionState { func (col Collection) State() data.CollectionState {

View File

@ -11,7 +11,8 @@ import (
) )
type mockColl struct { type mockColl struct {
p path.Path p path.Path
prevP path.Path
} }
func (mc mockColl) Items() <-chan Stream { func (mc mockColl) Items() <-chan Stream {
@ -23,7 +24,7 @@ func (mc mockColl) FullPath() path.Path {
} }
func (mc mockColl) PreviousPath() path.Path { func (mc mockColl) PreviousPath() path.Path {
return nil return mc.prevP
} }
func (mc mockColl) State() CollectionState { func (mc mockColl) State() CollectionState {
@ -54,7 +55,7 @@ func (suite *CollectionSuite) TestResourceOwnerSet() {
ToDataLayerExchangePathForCategory("tid", resource, path.EventsCategory, false) ToDataLayerExchangePathForCategory("tid", resource, path.EventsCategory, false)
require.NoError(t, err) require.NoError(t, err)
return mockColl{p} return mockColl{p, nil}
} }
table := []struct { table := []struct {