diff --git a/internal/object/object.repository_test.go b/internal/object/object.repository_test.go index 67d86a4..45c478e 100644 --- a/internal/object/object.repository_test.go +++ b/internal/object/object.repository_test.go @@ -45,7 +45,7 @@ func (t *ObjectRepositoryTest) TestCreateObjectSuccess() { url, key, err := repo.Upload([]byte{}, "mock-bucket", "mock-key") t.Nil(err) t.Equal("mock-key", key) - t.Equal(repo.GetURL("mock-bucket", "mock-key"), url) + t.Equal(repo.GetURL("mock-key"), url) } func (t *ObjectRepositoryTest) TestUploadSuccess() { @@ -57,7 +57,7 @@ func (t *ObjectRepositoryTest) TestUploadSuccess() { url, key, err := repo.Upload([]byte{}, "bucket", "object") t.Nil(err) t.Equal("object", key) - t.Equal(repo.GetURL("bucket", "object"), url) + t.Equal(repo.GetURL("object"), url) } func (t *ObjectRepositoryTest) TestUploadError() { @@ -101,7 +101,7 @@ func (t *ObjectRepositoryTest) TestGetSuccess() { url, err := repo.Get("bucket", "object") t.Nil(err) - t.Equal(repo.GetURL("bucket", "object"), url) + t.Equal(repo.GetURL("object"), url) } func (t *ObjectRepositoryTest) TestGetError() { @@ -130,6 +130,6 @@ func (t *ObjectRepositoryTest) TestGetStatusNotOK() { func (t *ObjectRepositoryTest) TestGetURL() { repo := object.NewRepository(t.conf, nil, nil) - url := repo.GetURL("bucket", "object") + url := repo.GetURL("object") t.Equal(t.mockEndpoint, url) } diff --git a/mocks/object/object.repository.go b/mocks/object/object.repository.go index 994b752..b68f327 100644 --- a/mocks/object/object.repository.go +++ b/mocks/object/object.repository.go @@ -63,17 +63,17 @@ func (mr *MockRepositoryMockRecorder) Get(bucketName, objectKey interface{}) *go } // GetURL mocks base method. -func (m *MockRepository) GetURL(bucketName, objectKey string) string { +func (m *MockRepository) GetURL(objectKey string) string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetURL", bucketName, objectKey) + ret := m.ctrl.Call(m, "GetURL", objectKey) ret0, _ := ret[0].(string) return ret0 } // GetURL indicates an expected call of GetURL. -func (mr *MockRepositoryMockRecorder) GetURL(bucketName, objectKey interface{}) *gomock.Call { +func (mr *MockRepositoryMockRecorder) GetURL(objectKey interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetURL", reflect.TypeOf((*MockRepository)(nil).GetURL), bucketName, objectKey) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetURL", reflect.TypeOf((*MockRepository)(nil).GetURL), objectKey) } // Upload mocks base method.