Skip to content

Commit

Permalink
Fixed tests after merge
Browse files Browse the repository at this point in the history
Signed-off-by: ItalyPaleAle <[email protected]>
  • Loading branch information
ItalyPaleAle committed Jul 5, 2022
1 parent c4ffa4c commit 9939d8c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bindings/azure/storagequeues/storagequeues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ import (

type MockHelper struct {
mock.Mock
messages chan []byte
decodeBase64 bool
messages chan []byte
metadata *storageQueuesMetadata
}

func (m *MockHelper) Init(metadata bindings.Metadata) (*storageQueuesMetadata, error) {
return parseMetadata(metadata)
m.messages = make(chan []byte, 10)
var err error
m.metadata, err = parseMetadata(metadata)
return m.metadata, err
}

func (m *MockHelper) Write(ctx context.Context, data []byte, ttl *time.Duration) error {
Expand All @@ -48,7 +51,7 @@ func (m *MockHelper) Read(ctx context.Context, consumer *consumer) error {

go func() {
for msg := range m.messages {
if m.decodeBase64 {
if m.metadata.DecodeBase64 {
msg, _ = base64.StdEncoding.DecodeString(string(msg))
}
go consumer.callback(ctx, &bindings.ReadResponse{
Expand Down

0 comments on commit 9939d8c

Please sign in to comment.