Skip to content

Commit

Permalink
chore: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Mar 7, 2024
1 parent 96751d0 commit 836d081
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func NewEnvironment(env *Environment) (*Environment, error) {
env.PublicRouter.Path("/ping").Methods("GET").HandlerFunc(addPingRoute)

// append HTTP routes
web.NewFilesController(env.Config.Logger, env.Config.Inbound.HTTP, httpFiles, inmemEvents, fileReceiver.CancellationResponses).AppendRoutes(env.PublicRouter)
web.NewFilesController(env.Config.Logger, env.Config.Inbound.HTTP, httpFiles, fileReceiver.CancellationResponses).AppendRoutes(env.PublicRouter)

// shard mapping HTTP routes
shardMappingService, err := shards.NewShardMappingService(stime.NewStaticTimeService(), env.Config.Logger, shardRepository)
Expand Down
2 changes: 1 addition & 1 deletion internal/pipeline/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (xfagg *aggregator) acceptFile(ctx context.Context, msg incoming.ACHFile) e
func (xfagg *aggregator) cancelFile(ctx context.Context, msg incoming.CancelACHFile) (models.FileCancellationResponse, error) {
response, err := xfagg.merger.HandleCancel(ctx, msg)
if err != nil {
return err
return models.FileCancellationResponse{}, err
}

// Send the response back
Expand Down
11 changes: 6 additions & 5 deletions internal/pipeline/mock_xfer_merging.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ import (
)

type MockXferMerging struct {
LatestFile *incoming.ACHFile
LatestCancel *incoming.CancelACHFile
processed *processedFiles
LatestFile *incoming.ACHFile
LatestCancel *incoming.CancelACHFile
CancellationResponse incoming.FileCancellationResponse
processed *processedFiles

Err error
}
Expand All @@ -38,9 +39,9 @@ func (merge *MockXferMerging) HandleXfer(_ context.Context, xfer incoming.ACHFil
return merge.Err
}

func (merge *MockXferMerging) HandleCancel(_ context.Context, cancel incoming.CancelACHFile) error {
func (merge *MockXferMerging) HandleCancel(_ context.Context, cancel incoming.CancelACHFile) (incoming.FileCancellationResponse, error) {
merge.LatestCancel = &cancel
return merge.Err
return merge.CancellationResponse, merge.Err
}

func (merge *MockXferMerging) WithEachMerged(_ context.Context, f func(context.Context, int, upload.Agent, *ach.File) (string, error)) (*processedFiles, error) {
Expand Down
8 changes: 4 additions & 4 deletions internal/test/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ func TestUploads(t *testing.T) {
require.NoError(t, err)
defer streamTopic.Shutdown(context.Background())

fileController := web.NewFilesController(logger, service.HTTPConfig{}, httpPub)
r := mux.NewRouter()
fileController.AppendRoutes(r)

outboundPath := setupTestDirectory(t, uploadConf)
fileRepo := &files.MockRepository{}

fileReceiver, err := pipeline.Start(ctx, logger, uploadConf, shardRepo, fileRepo, httpSub)
require.NoError(t, err)
t.Cleanup(func() { fileReceiver.Shutdown() })

fileController := web.NewFilesController(logger, service.HTTPConfig{}, httpPub, fileReceiver.CancellationResponses)
r := mux.NewRouter()
fileController.AppendRoutes(r)

adminServer := admintest.Server(t)
fileReceiver.RegisterAdminRoutes(adminServer)

Expand Down

0 comments on commit 836d081

Please sign in to comment.