@@ -28,7 +28,7 @@ import (
2828 "github.com/stretchr/testify/assert"
2929 "github.com/stretchr/testify/mock"
3030 "github.com/stretchr/testify/require"
31- "google.golang.org/protobuf/proto "
31+ "google.golang.org/protobuf/encoding/protojson "
3232)
3333
3434func TestUploadPolicyEvaluationsBundle (t * testing.T ) {
@@ -64,9 +64,9 @@ func TestUploadPolicyEvaluationsBundle(t *testing.T) {
6464 uploader : func (t * testing.T ) casclient.Uploader {
6565 t .Helper ()
6666 m := casclientmock .NewUploader (t )
67- m .On ("Upload" , mock .Anything , mock .Anything , "policy-evaluations.pb " , mock .MatchedBy (func (digest string ) bool {
67+ m .On ("Upload" , mock .Anything , mock .Anything , "policy-evaluations.json " , mock .MatchedBy (func (digest string ) bool {
6868 return len (digest ) > 7 && digest [:7 ] == "sha256:"
69- })).Return (& casclient.UpDownStatus {Filename : "policy-evaluations.pb " }, nil )
69+ })).Return (& casclient.UpDownStatus {Filename : "policy-evaluations.json " }, nil )
7070 return m
7171 },
7272 wantRef : true ,
@@ -113,7 +113,7 @@ func TestUploadPolicyEvaluationsBundle(t *testing.T) {
113113
114114 // Verify the digest matches what we'd expect from serializing the bundle
115115 bundle := & v1.PolicyEvaluationBundle {Evaluations : tc .evaluations }
116- data , err := proto .Marshal (bundle )
116+ data , err := protojson .Marshal (bundle )
117117 require .NoError (t , err )
118118 expectedDigest := fmt .Sprintf ("%x" , sha256 .Sum256 (data ))
119119 assert .Equal (t , expectedDigest , ref .Digest ["sha256" ])
0 commit comments