@@ -78,10 +78,30 @@ func (m *mockBatchStore) UpdateState(ctx context.Context, id string, version int
7878 return nil
7979}
8080
81+ type mockBatchDependentStore struct {
82+ createFunc func (ctx context.Context , batchDependent entity.BatchDependent ) error
83+ getFunc func (ctx context.Context , batchID string ) (entity.BatchDependent , error )
84+ }
85+
86+ func (m * mockBatchDependentStore ) Get (ctx context.Context , batchID string ) (entity.BatchDependent , error ) {
87+ if m .getFunc != nil {
88+ return m .getFunc (ctx , batchID )
89+ }
90+ return entity.BatchDependent {}, nil
91+ }
92+
93+ func (m * mockBatchDependentStore ) Create (ctx context.Context , batchDependent entity.BatchDependent ) error {
94+ if m .createFunc != nil {
95+ return m .createFunc (ctx , batchDependent )
96+ }
97+ return nil
98+ }
99+
81100type mockStorage struct {
82- requestStore storage.RequestStore
83- changeProviderStore storage.ChangeProviderStore
84- batchStore storage.BatchStore
101+ requestStore storage.RequestStore
102+ changeProviderStore storage.ChangeProviderStore
103+ batchStore storage.BatchStore
104+ batchDependentStore storage.BatchDependentStore
85105}
86106
87107func (m * mockStorage ) GetRequestStore () storage.RequestStore {
@@ -96,6 +116,10 @@ func (m *mockStorage) GetBatchStore() storage.BatchStore {
96116 return m .batchStore
97117}
98118
119+ func (m * mockStorage ) GetBatchDependentStore () storage.BatchDependentStore {
120+ return m .batchDependentStore
121+ }
122+
99123func (m * mockStorage ) Close () error {
100124 return nil
101125}
0 commit comments