package tests

import (
	"fmt"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"
	. "github.com/carbonblack/cb-event-forwarder/pkg/config"
	"github.com/carbonblack/cb-event-forwarder/pkg/outputs"
	"testing"
)

var MockUploadOutput = s3manager.UploadOutput{Location: "MockOutputLocation", UploadID: "MockUploadID", VersionID: nil}
var MockUploadError = fmt.Errorf("There was an error uploading to s3")
var MockInput = "{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Henry LLC\",\"program_name\":\"engage holistic experiences\",\"publisher\":\"Daniels and Sons\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"23:00 05/13/2021\",\"subject_name\":\"Synergized global analyzer\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAAA=\",\"md5\":\"E80897C8DEE2BA39352B6C3B531A72C5\",\"sensor_id\":6,\"sha256\":\"0B71CBDFC40F87D568277A1E457AC59DB3F54CEE45B0B06573F1E108E471B0F6\",\"size\":841410719,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"engineer one-to-one vortals\",\"utf8_company_name\":\"Roberson Inc\",\"utf8_copied_module_length\":841410719,\"utf8_file_description\":\"Experience pick meet within single should between clear.\",\"utf8_file_version\":\"5.4.65.46278\",\"utf8_internal_name\":\"large.jpg\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Mcclure Inc\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Miller-Nunez\",\"utf8_on_disk_filename\":\"C:\\\\consumer\\\\data\\\\town\\\\she\\\\system\\\\large.jpg\",\"utf8_original_file_name\":\"large.jpg\",\"utf8_private_build\":\"8.1\",\"utf8_product_description\":\"Free pass heart loss TV. Family consider position institution leg.\",\"utf8_product_name\":\"Hot nor they\",\"utf8_product_version\":\"1.1.32.37277\",\"utf8_special_build\":\"9.8\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Howe and Sons\",\"program_name\":\"enhance real-time action-items\",\"publisher\":\"Washington, Middleton and Smith\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 02/23/2022\",\"subject_name\":\"Decentralized 5thgeneration challenge\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"CAD5C58D61CC4ED5050B791BC920BE06\",\"sensor_id\":6,\"sha256\":\"BDD3EE612E40C5194EDA9284ECE5F6551A8387CB2AD85A1B247069AEBCC1268F\",\"size\":1427239621,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"deploy back-end communities\",\"utf8_company_name\":\"Martinez, Doyle and Mckinney\",\"utf8_copied_module_length\":1427239621,\"utf8_file_description\":\"Oil week camera even manager class line. Reduce surface itself assume past understand security.\",\"utf8_file_version\":\"7.3.46.37432\",\"utf8_internal_name\":\"they.wav\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Andrade-Adams\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Arroyo and Sons\",\"utf8_on_disk_filename\":\"E:\\\\allow\\\\partner\\\\military\\\\director\\\\edge\\\\they.wav\",\"utf8_original_file_name\":\"they.wav\",\"utf8_private_build\":\"8.2\",\"utf8_product_description\":\"History ball painting sit. Gun agency blood sure team.\",\"utf8_product_name\":\"Per pick once\",\"utf8_product_version\":\"8.1.81.65854\",\"utf8_special_build\":\"3.1\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Riley, Cox and Hunt\",\"program_name\":\"re-intermediate distributed systems\",\"publisher\":\"Lee and Sons\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 01/06/2022\",\"subject_name\":\"Inverse interactive time-frame\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAACA=\",\"md5\":\"F6D20801D62894B10555D8CCF2742ED1\",\"sensor_id\":6,\"sha256\":\"DA588FC8C99857FAF9520AFAF4B504A297E52CB2FD6C7F7849BE9D0E63EA2463\",\"size\":1523669940,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"facilitate e-business deliverables\",\"utf8_company_name\":\"Coleman, Price and Williams\",\"utf8_copied_module_length\":1523669940,\"utf8_file_description\":\"Me strategy happen together former eat kid I. Television gas attack think place.\",\"utf8_file_version\":\"4.8.99.59001\",\"utf8_internal_name\":\"forward.gif\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Kim, Kelly and Middleton\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Smith, Bell and Richardson\",\"utf8_on_disk_filename\":\"C:\\\\fact\\\\college\\\\find\\\\forward.gif\",\"utf8_original_file_name\":\"forward.gif\",\"utf8_private_build\":\"4.3\",\"utf8_product_description\":\"Standard order pass son fall join bad. President network note manager today road western product. Pull series others whole.\",\"utf8_product_name\":\"Indeed final once\",\"utf8_product_version\":\"2.5.49.17383\",\"utf8_special_build\":\"8.2\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"\",\"program_name\":\"\",\"publisher\":\"Kirk, Schroeder and Jones\",\"result\":\"Unsigned\",\"result_code\":\"0x800B0100\",\"sign_time\":\"\",\"subject_name\":\"\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"8F107B3EFFF0EE82C4D528A890233C3A\",\"sensor_id\":6,\"sha256\":\"A97317E3E3032AB11A166CAAF2BB2F24E97029CF1697F21B2D11C6E6BE763FD4\",\"size\":635466889,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"maximize efficient info-mediaries\",\"utf8_company_name\":\"Snyder Group\",\"utf8_copied_module_length\":635466889,\"utf8_file_description\":\"Until course different measure gas assume structure. Thing partner quality ability. Theory grow hear law middle scientist.\",\"utf8_file_version\":\"1.2.5.72954\",\"utf8_internal_name\":\"soon.doc\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Marquez-Griffin\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Ramirez, Mccall and Peck\",\"utf8_on_disk_filename\":\"F:\\\\manager\\\\white\\\\shoulder\\\\national\\\\soon.doc\",\"utf8_original_file_name\":\"soon.doc\",\"utf8_private_build\":\"7.8\",\"utf8_product_description\":\"Listen build garden anyone bag oil. Particularly treatment would condition. Speak may whom good.\",\"utf8_product_name\":\"Only yard cover\",\"utf8_product_version\":\"4.8.11.48892\",\"utf8_special_build\":\"6.0\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Hill, Whitehead and Baker\",\"program_name\":\"exploit bricks-and-clicks e-services\",\"publisher\":\"Green, Hill and Mckenzie\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 03/04/2022\",\"subject_name\":\"Right-sized transitional emulation\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"A6E6B5E0DCB67DA7B3EC9215B43A98B8\",\"sensor_id\":6,\"sha256\":\"79575452F5974ADA6A79AFB3400FDD73E3512B9EB7ECCC84C78AD2F0D0464396\",\"size\":1664788455,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"scale killer functionalities\",\"utf8_company_name\":\"Hansen, Morgan and Santiago\",\"utf8_copied_module_length\":1664788455,\"utf8_file_description\":\"Education soldier source radio very born. Fund action American sea popular.\",\"utf8_file_version\":\"8.4.99.67489\",\"utf8_internal_name\":\"I.bmp\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Rodriguez, Russell and Griffin\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Taylor, Foster and Carlson\",\"utf8_on_disk_filename\":\"D:\\\\physical\\\\company\\\\fill\\\\person\\\\I.bmp\",\"utf8_original_file_name\":\"I.bmp\",\"utf8_private_build\":\"0.2\",\"utf8_product_description\":\"Artist laugh front. Research clearly suggest interest consumer data may.\",\"utf8_product_name\":\"Smile north budget\",\"utf8_product_version\":\"1.5.54.82775\",\"utf8_special_build\":\"1.2\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Carney, Snyder and Carter\",\"program_name\":\"engineer dot-com e-tailers\",\"publisher\":\"Rodriguez-Hall\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"23:00 09/07/2021\",\"subject_name\":\"Open-source system-worthy product\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"CDDAE6FDD635BD603E4F7C530A34CBCA\",\"sensor_id\":6,\"sha256\":\"A18338CF8947BCA168F5768DAB1E8B8D216EA41E4BD5D19BB59D43D740D72BED\",\"size\":1005993120,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"scale B2C niches\",\"utf8_company_name\":\"Beasley PLC\",\"utf8_copied_module_length\":1005993120,\"utf8_file_description\":\"Interview high threat put.\",\"utf8_file_version\":\"5.5.15.77417\",\"utf8_internal_name\":\"apply.flac\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Bell, Sweeney and Zimmerman\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Foster Ltd\",\"utf8_on_disk_filename\":\"D:\\\\travel\\\\fight\\\\Congress\\\\it\\\\national\\\\apply.flac\",\"utf8_original_file_name\":\"apply.flac\",\"utf8_private_build\":\"3.6\",\"utf8_product_description\":\"Sound room notice per head find enough pressure. Cut participant resource expert people. Change especially success.\",\"utf8_product_name\":\"Grow live great\",\"utf8_product_version\":\"5.5.31.39193\",\"utf8_special_build\":\"9.9\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Martinez Ltd\",\"program_name\":\"innovate seamless mindshare\",\"publisher\":\"Schneider LLC\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"23:00 04/10/2022\",\"subject_name\":\"Front-line leadingedge analyzer\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"B7F3D1F6838ECF7588747340C61FD808\",\"sensor_id\":6,\"sha256\":\"CE102BEE7408EA1CDD2F8403A578E801FEA9A9C6E18F10A29EB7F4652DB2310B\",\"size\":1323378576,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"exploit transparent mindshare\",\"utf8_company_name\":\"Williams, Howard and Meyer\",\"utf8_copied_module_length\":1323378576,\"utf8_file_description\":\"Arrive program early year. Find paper world state. Wall kitchen land you condition voice candidate.\",\"utf8_file_version\":\"3.1.97.29455\",\"utf8_internal_name\":\"individual.avi\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Navarro, Anderson and Lewis\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Thomas Ltd\",\"utf8_on_disk_filename\":\"E:\\\\unit\\\\able\\\\we\\\\individual.avi\",\"utf8_original_file_name\":\"individual.avi\",\"utf8_private_build\":\"9.7\",\"utf8_product_description\":\"Year ask once factor soon. Really style its individual trouble. Heavy begin so hundred catch low.\",\"utf8_product_name\":\"Should political very\",\"utf8_product_version\":\"0.3.12.92602\",\"utf8_special_build\":\"1.2\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Jackson Ltd\",\"program_name\":\"engage robust markets\",\"publisher\":\"Wilson-Smith\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 12/12/2021\",\"subject_name\":\"Sharable zero-defect artificial intelligence\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"2610B270FC27EAA1BABD9C92792AD45E\",\"sensor_id\":6,\"sha256\":\"A59025D4AF64F31C5D461DE2AA7B60C2E56497701D75E43F682A37D8B8A1E201\",\"size\":519567466,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"benchmark B2B architectures\",\"utf8_company_name\":\"Nunez, Torres and Hunt\",\"utf8_copied_module_length\":519567466,\"utf8_file_description\":\"Argue what measure. Yard response mother culture reflect. Change culture once drop.\",\"utf8_file_version\":\"7.7.10.74034\",\"utf8_internal_name\":\"type.numbers\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Mills-Valdez\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Lopez-Smith\",\"utf8_on_disk_filename\":\"D:\\\\serious\\\\soldier\\\\president\\\\else\\\\type.numbers\",\"utf8_original_file_name\":\"type.numbers\",\"utf8_private_build\":\"5.7\",\"utf8_product_description\":\"Church million relate though model but case. While radio inside first.\",\"utf8_product_name\":\"Win though final\",\"utf8_product_version\":\"4.0.97.807\",\"utf8_special_build\":\"2.8\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Johnson-Mccarty\",\"program_name\":\"innovate cross-media experiences\",\"publisher\":\"Johnson, Pacheco and Walker\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 02/12/2022\",\"subject_name\":\"Team-oriented high-level software\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"690F2D7CFD249877ED656D5472038E42\",\"sensor_id\":6,\"sha256\":\"86305D80D79222711D3CA262D385E5F5B49A2705421E48C5294DFC514C90F52B\",\"size\":1240497124,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"drive viral infrastructures\",\"utf8_company_name\":\"Marquez PLC\",\"utf8_copied_module_length\":1240497124,\"utf8_file_description\":\"Exactly scientist none do into dog.\",\"utf8_file_version\":\"3.2.64.38298\",\"utf8_internal_name\":\"writer.mp4\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Porter, Griffin and Griffin\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Wilson-Garza\",\"utf8_on_disk_filename\":\"C:\\\\kitchen\\\\safe\\\\offer\\\\sing\\\\look\\\\writer.mp4\",\"utf8_original_file_name\":\"writer.mp4\",\"utf8_private_build\":\"4.7\",\"utf8_product_description\":\"Consumer but officer strong. Ready sister him young impact. Order wish many town thank challenge.\",\"utf8_product_name\":\"Price commercial pull\",\"utf8_product_version\":\"4.7.43.28471\",\"utf8_special_build\":\"9.7\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Keith-Garcia\",\"program_name\":\"transform transparent e-markets\",\"publisher\":\"Shepherd-Hudson\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"22:00 12/02/2021\",\"subject_name\":\"Optimized fresh-thinking approach\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"A4C20DE20C21DC1B71EACBB1EE48F298\",\"sensor_id\":6,\"sha256\":\"2ED056F5A2DC08B0148CC3C8DC9873804EB9A292B99357B8EED36CD96E70426C\",\"size\":1605976975,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"extend strategic interfaces\",\"utf8_company_name\":\"Tran, Alexander and Freeman\",\"utf8_copied_module_length\":1605976975,\"utf8_file_description\":\"General do none time.\",\"utf8_file_version\":\"8.1.36.56351\",\"utf8_internal_name\":\"image.flac\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Mccarthy, Hall and Smith\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Reyes and Sons\",\"utf8_on_disk_filename\":\"C:\\\\worker\\\\national\\\\where\\\\speak\\\\cold\\\\image.flac\",\"utf8_original_file_name\":\"image.flac\",\"utf8_private_build\":\"3.9\",\"utf8_product_description\":\"Thing bad Republican phone church what sure. Heavy party industry cut military foreign. Power charge whatever knowledge develop think bar.\",\"utf8_product_name\":\"Never fall blood\",\"utf8_product_version\":\"0.3.6.66189\",\"utf8_special_build\":\"6.1\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"\",\"program_name\":\"\",\"publisher\":\"Davis-Lopez\",\"result\":\"Unsigned\",\"result_code\":\"0x800B0100\",\"sign_time\":\"\",\"subject_name\":\"\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAACA=\",\"md5\":\"A4707263744A9415A3719A980025119B\",\"sensor_id\":6,\"sha256\":\"AD3B96E9B70DBF4CCB31E7AEFA0F804D44910B6E3FC931B7051025BF5FBA805D\",\"size\":1546184049,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"expedite plug-and-play e-markets\",\"utf8_company_name\":\"Miles and Sons\",\"utf8_copied_module_length\":1546184049,\"utf8_file_description\":\"Subject today case. Certain staff occur able institution.\",\"utf8_file_version\":\"1.1.78.46975\",\"utf8_internal_name\":\"appear.flac\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Conrad, Branch and Jordan\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Walker-Doyle\",\"utf8_on_disk_filename\":\"C:\\\\employee\\\\between\\\\which\\\\present\\\\appear.flac\",\"utf8_original_file_name\":\"appear.flac\",\"utf8_private_build\":\"8.2\",\"utf8_product_description\":\"Board local strategy item stock.\",\"utf8_product_name\":\"Order at through\",\"utf8_product_version\":\"9.4.63.53853\",\"utf8_special_build\":\"3.7\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Bennett-Gardner\",\"program_name\":\"enhance rich networks\",\"publisher\":\"Park-Burch\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"23:00 06/25/2022\",\"subject_name\":\"Seamless discrete attitude\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"8E6264E51EB721E61B1DD58226A2F23E\",\"sensor_id\":6,\"sha256\":\"03AF99214C197DFFEA43FDD9389899D0F11459BBB8C7C817C226B05B76D5BEAF\",\"size\":1208961253,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"evolve impactful markets\",\"utf8_company_name\":\"Maxwell-Davis\",\"utf8_copied_module_length\":1208961253,\"utf8_file_description\":\"Too bit but operation condition natural. Off in meet task almost management.\",\"utf8_file_version\":\"5.4.42.30995\",\"utf8_internal_name\":\"personal.avi\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Bennett, Torres and Johnson\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Salinas, Gentry and Lawrence\",\"utf8_on_disk_filename\":\"F:\\\\think\\\\occur\\\\material\\\\indicate\\\\would\\\\personal.avi\",\"utf8_original_file_name\":\"personal.avi\",\"utf8_private_build\":\"4.4\",\"utf8_product_description\":\"Care these list tree section. Entire radio fall political. Population next design once process nor nearly.\",\"utf8_product_name\":\"Recognize its assume\",\"utf8_product_version\":\"7.2.53.74908\",\"utf8_special_build\":\"7.2\"}\n{\"cb_server\":\"cbserver\",\"computer_name\":\"together-record-admit-picture\",\"digsig\":{\"issuer_name\":\"Brown-Farrell\",\"program_name\":\"productize mission-critical systems\",\"publisher\":\"Weber, Davis and Padilla\",\"result\":\"Signed\",\"result_code\":\"0x00000000\",\"sign_time\":\"23:00 05/24/2022\",\"subject_name\":\"Distributed full-range intranet\"},\"event_type\":\"binary_info\",\"icon\":null,\"image_file_header\":\"ZIYAAAAAAAAAAAAAAAAAAAAAAgA=\",\"md5\":\"03CD75DF1CAE8507382938C7A16E21EE\",\"sensor_id\":6,\"sha256\":\"9BC57F814F44DE20ED4E327B22EA130DFACF8DF42A69F4237D60AA1EEE1C8112\",\"size\":1870667678,\"timestamp\":1614379081,\"type\":\"ingress.event.module\",\"utf8_comments\":\"strategize innovative web-readiness\",\"utf8_company_name\":\"Freeman LLC\",\"utf8_copied_module_length\":1870667678,\"utf8_file_description\":\"Dinner game law listen. Power build several manager produce.\",\"utf8_file_version\":\"1.6.11.96067\",\"utf8_internal_name\":\"board.avi\",\"utf8_legal_copyright\":\"Copyright (c) 2019 Branch-Combs\",\"utf8_legal_trademark\":\"Trademark (tm) 2019 Hopkins-Olson\",\"utf8_on_disk_filename\":\"C:\\\\travel\\\\state\\\\material\\\\east\\\\board.avi\",\"utf8_original_file_name\":\"board.avi\",\"utf8_private_build\":\"0.8\",\"utf8_product_description\":\"Fight method partner history its throughout cup. College building or model notice stop use.\",\"utf8_product_name\":\"Prevent tv drug\",\"utf8_product_version\":\"1.6.42.14853\",\"utf8_special_build\":\"8.3\"}\n"

type NOPUploader struct {
	UploadCalled bool
}

func (uploader *NOPUploader) Upload(input *s3manager.UploadInput, options ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error) {
	return &MockUploadOutput, nil
}

func TestS3LZ4(t *testing.T) {
	configForS3 := Configuration{CompressionType: LZ4COMPRESSION, FileHandlerCompressData: true, S3Concurrency: 10}
	uploader := NOPUploader{UploadCalled: false}
	s3Publisher := outputs.NewS3ChunkingPublisher(&configForS3, &uploader, "MockBucket")
	err := s3Publisher.Start()
	if err != nil {
		t.Fatal(err)
	} else {
		t.Log("Started OK")
	}
	s3Publisher.Input <- MockInput
	if !uploader.UploadCalled {
		t.Failed()
	}
	s3Publisher.Stop()
}

func TestS3GZ(t *testing.T) {
	configForS3 := Configuration{CompressionType: GZIPCOMPRESSION, FileHandlerCompressData: true, S3Concurrency: 10}
	uploader := NOPUploader{UploadCalled: false}
	s3Publisher := outputs.NewS3ChunkingPublisher(&configForS3, &uploader, "MockBucket")
	err := s3Publisher.Start()
	if err != nil {
		t.Fatal(err)
	} else {
		t.Log("Started ok")
	}
	s3Publisher.Input <- MockInput
	if !uploader.UploadCalled {
		t.Failed()
	}
	s3Publisher.Stop()
}
