Skip to content

Commit

Permalink
Merge branch 'integrationTesting' into INT-B-21480
Browse files Browse the repository at this point in the history
  • Loading branch information
samaysofo authored Jan 29, 2025
2 parents e6e4ff4 + 83d3ac8 commit 7b9b47a
Show file tree
Hide file tree
Showing 57 changed files with 127 additions and 392 deletions.
6 changes: 3 additions & 3 deletions pkg/factory/prime_upload_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (suite *FactorySuite) TestBuildPrimeUpload() {
// Mocked: None
// Set up: Create an upload with an uploader and default file
// Expected outcome:Upload filename should be the default file
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
primeUploader, err := uploader.NewPrimeUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down Expand Up @@ -195,7 +195,7 @@ func (suite *FactorySuite) TestBuildPrimeUpload() {
// Set up: Create a prime upload with a user uploader
// but no appcontext
// Expected outcome:Should cause a panic
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
primeUploader, err := uploader.NewPrimeUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand All @@ -217,7 +217,7 @@ func (suite *FactorySuite) TestBuildPrimeUpload() {
// Mocked: None
// Set up: Create a prime upload with a specific file
// Expected outcome:PrimeUpload should be created with default values
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
primeUploader, err := uploader.NewPrimeUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down
6 changes: 3 additions & 3 deletions pkg/factory/service_request_document_upload_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (suite *FactorySuite) TestBuildServiceRequestDocumentUpload() {
// Mocked: None
// Set up: Create an upload with an uploader and default file
// Expected outcome:Upload filename should be the default file
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
serviceRequestDocumentUploader, err := uploader.NewServiceRequestUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down Expand Up @@ -219,7 +219,7 @@ func (suite *FactorySuite) TestBuildServiceRequestDocumentUpload() {
// Set up: Create a service request document upload with a user uploader
// but no appcontext
// Expected outcome:Should cause a panic
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
serviceRequestDocumentUploader, err := uploader.NewServiceRequestUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand All @@ -241,7 +241,7 @@ func (suite *FactorySuite) TestBuildServiceRequestDocumentUpload() {
// Mocked: None
// Set up: Create a service request document upload with a specific file
// Expected outcome:ServiceRequestDocumentUpload should be created with default values
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
serviceRequestDocumentUploader, err := uploader.NewServiceRequestUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down
6 changes: 3 additions & 3 deletions pkg/factory/upload_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (suite *FactorySuite) TestBuildUpload() {
// Mocked: None
// Set up: Create an upload with an uploader and default file
// Expected outcome:Upload filename should be the default file
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
uploader, err := uploaderPkg.NewUploader(storer, 100*uploaderPkg.MB, "USER")
suite.NoError(err)

Expand All @@ -84,7 +84,7 @@ func (suite *FactorySuite) TestBuildUpload() {
// Mocked: None
// Set up: Create an upload with an uploader but no appcontext
// Expected outcome:Should cause a panic
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
uploader, err := uploaderPkg.NewUploader(storer, 100*uploaderPkg.MB, "USER")
suite.NoError(err)

Expand All @@ -105,7 +105,7 @@ func (suite *FactorySuite) TestBuildUpload() {
// Mocked: None
// Set up: Create an upload with a specific file
// Expected outcome:User should be created with default values
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
uploader, err := uploaderPkg.NewUploader(storer, 100*uploaderPkg.MB, "USER")
suite.NoError(err)

Expand Down
6 changes: 3 additions & 3 deletions pkg/factory/user_upload_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (suite *FactorySuite) TestBuildUserUpload() {
// Mocked: None
// Set up: Create an upload with an uploader and default file
// Expected outcome:Upload filename should be the default file
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
userUploader, err := uploader.NewUserUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down Expand Up @@ -158,7 +158,7 @@ func (suite *FactorySuite) TestBuildUserUpload() {
// Set up: Create a user upload with a user uploader
// but no appcontext
// Expected outcome:Should cause a panic
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
userUploader, err := uploader.NewUserUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand All @@ -180,7 +180,7 @@ func (suite *FactorySuite) TestBuildUserUpload() {
// Mocked: None
// Set up: Create a user upload with a specific file
// Expected outcome:UserUpload should be created with default values
storer := storageTest.NewFakeS3Storage(true, nil)
storer := storageTest.NewFakeS3Storage(true)
userUploader, err := uploader.NewUserUploader(storer, 100*uploader.MB)
suite.NoError(err)

Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/ghcapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (suite *HandlerSuite) AfterTest() {

func (suite *HandlerSuite) createS3HandlerConfig() handlers.HandlerConfig {
handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)

return handlerConfig
Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/ghcapi/documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (suite *HandlerSuite) TestGetDocumentHandler() {
params.HTTPRequest = req

handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)
handler := GetDocumentHandler{handlerConfig}

Expand Down Expand Up @@ -106,7 +106,7 @@ func (suite *HandlerSuite) TestGetDocumentHandlerForFilenamesWithCommas() {
params.HTTPRequest = req

handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)
handler := GetDocumentHandler{handlerConfig}

Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/ghcapi/internal/payloads/payloads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestHandlerSuite(t *testing.T) {
hs := &PayloadsSuite{
BaseHandlerTestSuite: handlers.NewBaseHandlerTestSuite(notifications.NewStubNotificationSender("milmovelocal"), testingsuite.CurrentPackage(),
testingsuite.WithPerTestTransaction()),
storer: storageTest.NewFakeS3Storage(true, nil),
storer: storageTest.NewFakeS3Storage(true),
}

suite.Run(t, hs)
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/ghcapi/move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ func (suite *HandlerSuite) TestUpdateMoveCloseoutOfficeHandler() {
}

func (suite *HandlerSuite) TestUploadAdditionalDocumentsHander() {
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
uploadCreator := upload.NewUploadCreator(fakeS3)
additionalDocumentsUploader := moveservice.NewMoveAdditionalDocumentsUploader(uploadCreator)

Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/ghcapi/orders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (suite *HandlerSuite) TestCreateOrder() {
CreateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
createHandler := CreateOrderHandler{handlerConfig, waf}
Expand Down Expand Up @@ -213,7 +213,7 @@ func (suite *HandlerSuite) TestCreateOrderWithOCONUSValues() {
CreateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
createHandler := CreateOrderHandler{handlerConfig, waf}
Expand Down
10 changes: 5 additions & 5 deletions pkg/handlers/ghcapi/uploads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func makeRequest(suite *HandlerSuite, params uploadop.CreateUploadParams, servic

func (suite *HandlerSuite) TestCreateUploadsHandlerSuccess() {
t := suite.T()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
document, params := createPrereqs(suite, FixturePDF)

response := makeRequest(suite, params, document.ServiceMember, fakeS3)
Expand All @@ -65,7 +65,7 @@ func (suite *HandlerSuite) TestCreateUploadsHandlerSuccess() {

func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithWrongUser() {
t := suite.T()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
_, params := createPrereqs(suite, FixturePDF)

// Create a user that is not associated with the move
Expand All @@ -91,7 +91,7 @@ func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithWrongUser() {
func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithMissingDoc() {
t := suite.T()

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
document, params := createPrereqs(suite, FixturePDF)

// Make a document ID that is not actually associated with a document
Expand All @@ -117,7 +117,7 @@ func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithMissingDoc() {
func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithZeroLengthFile() {
t := suite.T()

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
document, params := createPrereqs(suite, FixturePDF)

params.File = suite.Fixture("empty.pdf")
Expand All @@ -138,7 +138,7 @@ func (suite *HandlerSuite) TestCreateUploadsHandlerFailsWithZeroLengthFile() {

func (suite *HandlerSuite) TestCreateUploadsHandlerFailure() {
t := suite.T()
fakeS3 := storageTest.NewFakeS3Storage(false, nil)
fakeS3 := storageTest.NewFakeS3Storage(false)
document, params := createPrereqs(suite, FixturePDF)

currentCount, countErr := suite.DB().Count(&models.Upload{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/internalapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func (suite *HandlerSuite) createS3HandlerConfig() handlers.HandlerConfig {
handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)
handlerConfig.SetNotificationSender(suite.TestNotificationSender())

Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/internalapi/documents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (suite *HandlerSuite) TestShowDocumentHandler() {
params.HTTPRequest = req

handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)
handler := ShowDocumentHandler{handlerConfig}
response := handler.Handle(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestHandlerSuite(t *testing.T) {
hs := &PayloadsSuite{
BaseHandlerTestSuite: handlers.NewBaseHandlerTestSuite(notifications.NewStubNotificationSender("milmovelocal"), testingsuite.CurrentPackage(),
testingsuite.WithPerTestTransaction()),
storer: storageTest.NewFakeS3Storage(true, nil),
storer: storageTest.NewFakeS3Storage(true),
}

suite.Run(t, hs)
Expand Down
4 changes: 2 additions & 2 deletions pkg/handlers/internalapi/moves_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func (suite *HandlerSuite) TestSubmitGetAllMovesHandler() {
}

// And: a move is submitted
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)

Expand All @@ -539,7 +539,7 @@ func (suite *HandlerSuite) TestSubmitGetAllMovesHandler() {
}

func (suite *HandlerSuite) TestUploadAdditionalDocumentsHander() {
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
uploadCreator := upload.NewUploadCreator(fakeS3)
additionalDocumentsUploader := move.NewMoveAdditionalDocumentsUploader(uploadCreator)

Expand Down
18 changes: 9 additions & 9 deletions pkg/handlers/internalapi/orders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (suite *HandlerSuite) TestCreateOrder() {
CreateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
createHandler := CreateOrdersHandler{handlerConfig}
Expand Down Expand Up @@ -212,7 +212,7 @@ func (suite *HandlerSuite) TestCreateOrder() {
CreateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
createHandler := CreateOrdersHandler{handlerConfig}
Expand Down Expand Up @@ -334,7 +334,7 @@ func (suite *HandlerSuite) TestCreateOrder() {
CreateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
createHandler := CreateOrdersHandler{handlerConfig}
Expand Down Expand Up @@ -370,7 +370,7 @@ func (suite *HandlerSuite) TestShowOrder() {
OrdersID: *handlers.FmtUUID(order.ID),
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
showHandler := ShowOrdersHandler{handlerConfig}
Expand Down Expand Up @@ -405,7 +405,7 @@ func (suite *HandlerSuite) TestPayloadForOrdersModel() {
},
}, nil)

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)

payload, err := payloadForOrdersModel(fakeS3, order)
suite.NoError(err)
Expand Down Expand Up @@ -786,7 +786,7 @@ func (suite *HandlerSuite) TestUpdateOrdersHandler() {
UpdateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)

Expand Down Expand Up @@ -938,7 +938,7 @@ func (suite *HandlerSuite) TestUpdateOrdersHandler() {
UpdateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)

Expand Down Expand Up @@ -1084,7 +1084,7 @@ func (suite *HandlerSuite) TestUpdateOrdersHandlerOriginPostalCodeAndGBLOC() {
UpdateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)

Expand Down Expand Up @@ -1226,7 +1226,7 @@ func (suite *HandlerSuite) TestUpdateOrdersHandlerWithCounselingOffice() {
UpdateOrders: payload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)

Expand Down
6 changes: 3 additions & 3 deletions pkg/handlers/internalapi/service_members_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (suite *HandlerSuite) TestPatchServiceMemberHandler() {
PatchServiceMemberPayload: &patchPayload,
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
handler := PatchServiceMemberHandler{handlerConfig}
Expand Down Expand Up @@ -434,7 +434,7 @@ func (suite *HandlerSuite) TestPatchServiceMemberHandlerSubmittedMove() {
}

handlerConfig := suite.HandlerConfig()
fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig.SetFileStorer(fakeS3)
handler := PatchServiceMemberHandler{handlerConfig}
response := handler.Handle(params)
Expand Down Expand Up @@ -585,7 +585,7 @@ func (suite *HandlerSuite) TestShowServiceMemberOrders() {
ServiceMemberID: strfmt.UUID(order1.ServiceMemberID.String()),
}

fakeS3 := storageTest.NewFakeS3Storage(true, nil)
fakeS3 := storageTest.NewFakeS3Storage(true)
handlerConfig := suite.HandlerConfig()
handlerConfig.SetFileStorer(fakeS3)
handler := ShowServiceMemberOrdersHandler{handlerConfig}
Expand Down
Loading

0 comments on commit 7b9b47a

Please sign in to comment.