Skip to content

Commit

Permalink
Improving marshaller testing
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffrey Beausire <[email protected]>
  • Loading branch information
geobeau committed Dec 17, 2018
1 parent bcd5ed0 commit abf8a9a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugin/storage/kafka/marshalling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,22 @@ func TestZipkinThriftUnmarshaller(t *testing.T) {
_, err := unmarshaller.Unmarshal(bytes)
assert.NoError(t, err)
}

func TestZipkinThriftUnmarshallerErrorNoService(t *testing.T) {
bytes := zipkin.ZipkinSerialize([]*zipkincore.Span{
{
ID: 12345,
Name: "foo",
},
})
unmarshaller := NewZipkinThriftUnmarshaller()
_, err := unmarshaller.Unmarshal(bytes)
assert.Error(t, err)
}

func TestZipkinThriftUnmarshallerErrorCorrupted(t *testing.T) {
bytes := []byte("foo")
unmarshaller := NewZipkinThriftUnmarshaller()
_, err := unmarshaller.Unmarshal(bytes)
assert.Error(t, err)
}

0 comments on commit abf8a9a

Please sign in to comment.