Skip to content

Commit

Permalink
Update s3_batch_job_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
lyoung-confluent authored Jan 25, 2024
1 parent 4b16f6a commit 83ff1ff
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions events/s3_batch_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,30 @@ import (
"github.com/stretchr/testify/assert"
)

func TestS3BatchJobEventMarshaling(t *testing.T) {
func TestS3BatchJobEventMarshalingSchema1(t *testing.T) {

// 1. read JSON from file
inputJSON := test.ReadJSONFromFile(t, "./testdata/s3-batch-job-event-request.json")
inputJSON := test.ReadJSONFromFile(t, "./testdata/s3-batch-job-event-request-1.0.json")

// 2. de-serialize into Go object
var inputEvent S3BatchJobEvent
if err := json.Unmarshal(inputJSON, &inputEvent); err != nil {
t.Errorf("could not unmarshal event. details: %v", err)
}

// 3. serialize to JSON
outputJSON, err := json.Marshal(inputEvent)
if err != nil {
t.Errorf("could not marshal event. details: %v", err)
}

// 4. check result
assert.JSONEq(t, string(inputJSON), string(outputJSON))
}

func TestS3BatchJobEventMarshalingSchema2(t *testing.T) {
// 1. read JSON from file
inputJSON := test.ReadJSONFromFile(t, "./testdata/s3-batch-job-event-request-2.0.json")

// 2. de-serialize into Go object
var inputEvent S3BatchJobEvent
Expand Down

0 comments on commit 83ff1ff

Please sign in to comment.