Skip to content

Commit

Permalink
rev: unintended changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelact committed Jun 14, 2023
1 parent 1e293fe commit a874d4a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/notifiers/notifiers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ import (
"testing"
"time"

"github.com/golang/protobuf/ptypes"
"google.golang.org/protobuf/protoadapt"

"github.com/golang/protobuf/proto"
cbpb "cloud.google.com/go/cloudbuild/apiv1/v2/cloudbuildpb"
"google.golang.org/protobuf/proto"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
cbpb "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/timestamppb"
Expand All @@ -45,10 +45,7 @@ func convertToTimestamp(t *testing.T, datetime string) *timestamppb.Timestamp {
if err != nil {
t.Fatalf("Failed to parse datetime string: %v", err)
}
ppbtimestamp, err := ptypes.TimestampProto(timestamp)
if err != nil {
t.Fatalf("Failed to parse timestamp: %v", err)
}
ppbtimestamp := timestamppb.New(timestamp)
return ppbtimestamp
}

Expand Down Expand Up @@ -691,7 +688,7 @@ func TestNewReceiver(t *testing.T) {
Tags: []string{t.Name()},
Images: []string{"gcr.io/example/image"},
}
sentBuildV2 := proto.MessageV2(sentBuild)
sentBuildV2 := protoadapt.MessageV2Of(sentBuild)
sentJSON, err := protojson.Marshal(sentBuildV2)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -755,7 +752,7 @@ func wrapperToBuffer(t *testing.T, w *pubSubPushWrapper) *bytes.Buffer {

func buildToBuffer(t *testing.T, b *cbpb.Build) *bytes.Buffer {
t.Helper()
b2 := proto.MessageV2(b)
b2 := protoadapt.MessageV2Of(b)
j, err := protojson.Marshal(b2)
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit a874d4a

Please sign in to comment.