Skip to content

Commit

Permalink
Take unmarshaller as parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Davit Yeghshatyan <[email protected]>
  • Loading branch information
Davit Yeghshatyan committed Jul 24, 2018
1 parent 5b8fad1 commit 453c715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/ingester/app/processor/span_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ type Message interface {
}

// NewSpanProcessor creates a new SpanProcessor
func NewSpanProcessor(writer spanstore.Writer) SpanProcessor {
func NewSpanProcessor(writer spanstore.Writer, unmarshaller kafka.Unmarshaller) SpanProcessor {
return &spanProcessor{
unmarshaller: kafka.NewProtobufUnmarshaller(),
unmarshaller: unmarshaller,
writer: writer,
}
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/ingester/app/processor/span_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

kmocks "github.com/jaegertracing/jaeger/cmd/ingester/app/consumer/mocks"
cmocks "github.com/jaegertracing/jaeger/cmd/ingester/app/consumer/mocks"
"github.com/jaegertracing/jaeger/model"
umocks "github.com/jaegertracing/jaeger/pkg/kafka/mocks"
smocks "github.com/jaegertracing/jaeger/storage/spanstore/mocks"
)

func TestNewSpanProcessor(t *testing.T) {
assert.NotNil(t, NewSpanProcessor(&smocks.Writer{}))
assert.NotNil(t, NewSpanProcessor(&smocks.Writer{}, &umocks.Unmarshaller{}))
}

func TestSpanProcessor_Process(t *testing.T) {
Expand All @@ -38,7 +38,7 @@ func TestSpanProcessor_Process(t *testing.T) {
writer: writer,
}

message := &kmocks.Message{}
message := &cmocks.Message{}
data := []byte("police")
span := &model.Span{}

Expand All @@ -60,7 +60,7 @@ func TestSpanProcessor_ProcessError(t *testing.T) {
writer: writer,
}

message := &kmocks.Message{}
message := &cmocks.Message{}
data := []byte("police")

message.On("Value").Return(data)
Expand Down

0 comments on commit 453c715

Please sign in to comment.