mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-31 15:29:48 +02:00
zero: resource bundle reconciler (#4445)
This commit is contained in:
parent
788376bf60
commit
3b65049d2f
18 changed files with 1560 additions and 0 deletions
29
internal/zero/reconciler/download_cache_test.go
Normal file
29
internal/zero/reconciler/download_cache_test.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package reconciler_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/reconciler"
|
||||
zero_sdk "github.com/pomerium/zero-sdk"
|
||||
)
|
||||
|
||||
func TestCacheEntryProto(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
original := reconciler.BundleCacheEntry{
|
||||
DownloadConditional: zero_sdk.DownloadConditional{
|
||||
ETag: "etag value",
|
||||
LastModified: "2009-02-13 18:31:30 -0500 EST",
|
||||
},
|
||||
RecordTypes: []string{"one", "two"},
|
||||
}
|
||||
originalProto, err := original.ToAny()
|
||||
require.NoError(t, err)
|
||||
var unmarshaled reconciler.BundleCacheEntry
|
||||
err = unmarshaled.FromAny(originalProto)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, original.Equals(&unmarshaled))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue