mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
81974b977d
* fix: font color * fix: assets from iam when policy is default * fix: remove multiple files * fix mock storage * doc: add asset api * build assets docs * fix operator test * docs * fix remove assets from org label policy and not default * fix remove label policy assets and feature downgrade correctly * fix storage mock * Update docs/docs/apis/apis.md Co-authored-by: fabi <fabienne.gerschwiler@gmail.com> Co-authored-by: Fabi <38692350+fgerschwiler@users.noreply.github.com>
49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
package mock
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/golang/mock/gomock"
|
|
|
|
caos_errors "github.com/caos/zitadel/internal/errors"
|
|
)
|
|
|
|
func NewStorage(t *testing.T) *MockStorage {
|
|
return NewMockStorage(gomock.NewController(t))
|
|
}
|
|
|
|
func (m *MockStorage) ExpectAddObjectNoError() *MockStorage {
|
|
m.EXPECT().
|
|
PutObject(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
|
|
Return(nil, nil)
|
|
return m
|
|
}
|
|
|
|
func (m *MockStorage) ExpectAddObjectError() *MockStorage {
|
|
m.EXPECT().
|
|
PutObject(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
|
|
Return(nil, caos_errors.ThrowInternal(nil, "", ""))
|
|
return m
|
|
}
|
|
|
|
func (m *MockStorage) ExpectRemoveObjectNoError() *MockStorage {
|
|
m.EXPECT().
|
|
RemoveObject(gomock.Any(), gomock.Any(), gomock.Any()).
|
|
Return(nil)
|
|
return m
|
|
}
|
|
|
|
func (m *MockStorage) ExpectRemoveObjectsNoError() *MockStorage {
|
|
m.EXPECT().
|
|
RemoveObjects(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
|
|
Return(nil)
|
|
return m
|
|
}
|
|
|
|
func (m *MockStorage) ExpectRemoveObjectError() *MockStorage {
|
|
m.EXPECT().
|
|
RemoveObject(gomock.Any(), gomock.Any(), gomock.Any()).
|
|
Return(caos_errors.ThrowInternal(nil, "", ""))
|
|
return m
|
|
}
|