@@ -10,7 +10,7 @@ import (
1010
1111 "github.com/riverqueue/river/internal/jobexecutor"
1212 "github.com/riverqueue/river/internal/rivercommon"
13- "github.com/riverqueue/river/internal/rivermiddleware "
13+ "github.com/riverqueue/river/internal/riverplugin "
1414 "github.com/riverqueue/river/rivertype"
1515)
1616
@@ -32,7 +32,7 @@ func TestResumableStep(t *testing.T) {
3232 ctx , _ , job := setup (t , `{}` )
3333
3434 var ran []string
35- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
35+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
3636 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
3737 ran = append (ran , "first" )
3838 return nil
@@ -54,7 +54,7 @@ func TestResumableStep(t *testing.T) {
5454 ctx , _ , job := setup (t , `{"river:resumable_step":"step2"}` )
5555
5656 var ran []string
57- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
57+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
5858 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
5959 ran = append (ran , "first" )
6060 return nil
@@ -88,7 +88,7 @@ func TestResumableStep(t *testing.T) {
8888 ctx , metadataUpdates , job := setup (t , `{}` )
8989
9090 var ran []string
91- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
91+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
9292 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
9393 ran = append (ran , "step1" )
9494 return nil
@@ -111,7 +111,7 @@ func TestResumableStep(t *testing.T) {
111111 ctx , metadataUpdates , job = setup (t , `{"river:resumable_step":"step1"}` )
112112 ran = nil
113113
114- err = (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
114+ err = (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
115115 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
116116 ran = append (ran , "step1" )
117117 return nil
@@ -140,7 +140,7 @@ func TestResumableStep(t *testing.T) {
140140 defer cancel ()
141141
142142 var ran []string
143- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
143+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
144144 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
145145 ran = append (ran , "step1" )
146146 cancel ()
@@ -185,7 +185,7 @@ func TestResumableStepCursor(t *testing.T) {
185185 ctx , _ , job := setup (t , `{}` )
186186
187187 var ran []string
188- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
188+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
189189 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
190190 ran = append (ran , "step" )
191191 return nil
@@ -210,7 +210,7 @@ func TestResumableStepCursor(t *testing.T) {
210210 cursorResult resumableCursor
211211 ran []int
212212 )
213- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
213+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
214214 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
215215 ran = append (ran , 1 )
216216 return nil
@@ -240,7 +240,7 @@ func TestResumableStepCursor(t *testing.T) {
240240 cursorResult = resumableCursor {}
241241 ran = nil
242242
243- err = (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
243+ err = (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
244244 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
245245 ran = append (ran , 1 )
246246 return nil
@@ -271,7 +271,7 @@ func TestResumableStepCursor(t *testing.T) {
271271 ctx , metadataUpdates , job := setup (t , `{"river:resumable_cursor":{"step2":{"id":42}},"river:resumable_step":"step1"}` )
272272
273273 var ran []int
274- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
274+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
275275 ResumableStep (ctx , "step1" , nil , func (ctx context.Context ) error {
276276 ran = append (ran , 1 )
277277 return nil
@@ -306,7 +306,7 @@ func TestResumableStepCursor(t *testing.T) {
306306
307307 ctx , _ , _ := setup (t , `{}` )
308308
309- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , & rivertype.JobRow {Metadata : []byte (`{}` )}, func (ctx context.Context ) error {
309+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , & rivertype.JobRow {Metadata : []byte (`{}` )}, func (ctx context.Context ) error {
310310 return ResumableSetCursor (ctx , 1 )
311311 })
312312 require .ErrorIs (t , err , errResumableCursorNotInStep )
@@ -321,7 +321,7 @@ func TestResumableStepCursor(t *testing.T) {
321321
322322 ctx , metadataUpdates , job := setup (t , `{}` )
323323
324- err := (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
324+ err := (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
325325 ResumableStepCursor (ctx , "step1" , nil , func (ctx context.Context , cursor int ) error {
326326 require .Zero (t , cursor )
327327 require .NoError (t , ResumableSetCursor (ctx , 123 ))
@@ -343,7 +343,7 @@ func TestResumableStepCursor(t *testing.T) {
343343
344344 ctx , metadataUpdates , job = setup (t , `{"river:resumable_cursor":{"step1":123,"step2":{"id":"abc"}},"river:resumable_step":"step1"}` )
345345
346- err = (& rivermiddleware .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
346+ err = (& riverplugin .ResumableMiddleware {}).Work (ctx , job , func (ctx context.Context ) error {
347347 ResumableStepCursor (ctx , "step1" , nil , func (ctx context.Context , cursor int ) error {
348348 require .Equal (t , 123 , cursor )
349349 return nil
0 commit comments