Skip to content

Commit

Permalink
Fix metadata repository mock to respect metadata.Repository interface
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.dev>
  • Loading branch information
teran committed Jul 10, 2024
1 parent fe27eae commit 5c55f5f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions repositories/metadata/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import (
"context"

"github.com/stretchr/testify/mock"
"github.com/teran/archived/repositories/metadata"
)

var _ metadata.Repository = (*Mock)(nil)

type Mock struct {
mock.Mock
}
Expand Down Expand Up @@ -73,3 +76,8 @@ func (m *Mock) CreateBLOB(_ context.Context, checksum string, size uint64, mimeT
args := m.Called(checksum, size, mimeType)
return args.Error(0)
}

func (m *Mock) GetBlobKeyByObject(_ context.Context, container, version, key string) (string, error) {
args := m.Called(container, version, key)
return args.String(0), args.Error(1)
}

0 comments on commit 5c55f5f

Please sign in to comment.