mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 10:26:29 +02:00
29 lines
748 B
Go
29 lines
748 B
Go
package reconciler_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
zero_sdk "github.com/pomerium/pomerium/internal/zero/api"
|
|
"github.com/pomerium/pomerium/internal/zero/reconciler"
|
|
)
|
|
|
|
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))
|
|
}
|