├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── improvement.yml │ └── pattern_submission.yml ├── metadata │ ├── metadata_json_schema.json │ ├── metadata_json_validator.py │ └── requirements.txt └── workflows │ ├── dotnet.yml │ ├── getPatternFolder.py │ ├── metadata-validation.yml │ ├── python-app.yml │ ├── requirements.txt │ └── typescript-pr-tests.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── Serverless-Testing-Principles.md ├── Submitting-Test-Patterns.md ├── _img └── main_header.png ├── dotnet-test-samples ├── .gitignore ├── README-ASYNC.md ├── README.md ├── apigw-lambda-ddb │ ├── README.md │ ├── ServerlessTestApi.sln │ ├── img │ │ └── apigw-lambda-ddb.jpg │ ├── metadata.json │ ├── src │ │ ├── DeleteProduct │ │ │ ├── DeleteProduct.csproj │ │ │ ├── Function.cs │ │ │ └── aws-lambda-tools-defaults.json │ │ ├── GetProduct │ │ │ ├── Function.cs │ │ │ ├── GetProduct.csproj │ │ │ └── aws-lambda-tools-defaults.json │ │ ├── GetProducts │ │ │ ├── Function.cs │ │ │ ├── GetProducts.csproj │ │ │ └── aws-lambda-tools-defaults.json │ │ ├── PutProduct │ │ │ ├── Function.cs │ │ │ ├── PutProduct.csproj │ │ │ └── aws-lambda-tools-defaults.json │ │ ├── ServerlessTestApi.Core │ │ │ ├── DataAccess │ │ │ │ ├── IProductsDAO.cs │ │ │ │ └── UpsertOperation.cs │ │ │ ├── Models │ │ │ │ ├── Product.cs │ │ │ │ ├── ProductDTO.cs │ │ │ │ └── ProductWrapper.cs │ │ │ └── ServerlessTestApi.Core.csproj │ │ └── ServerlessTestApi.Infrastructure │ │ │ ├── AssemblyInfo.cs │ │ │ ├── DataAccess │ │ │ ├── DynamoDbProducts.cs │ │ │ └── ProductMapper.cs │ │ │ ├── DynamoDbOptions.cs │ │ │ ├── DynamoDbOptionsValidator.cs │ │ │ ├── LambdaContextExtensions.cs │ │ │ ├── ServerlessTestApi.Infrastructure.csproj │ │ │ └── Startup.cs │ ├── template.yaml │ └── tests │ │ ├── ApiTests.IntegrationTest │ │ ├── ApiTests.IntegrationTest.csproj │ │ ├── Drivers │ │ │ ├── Product.cs │ │ │ └── ProductWrapper.cs │ │ ├── IntegrationTest.cs │ │ ├── Setup.cs │ │ ├── TestOrderAttribute.cs │ │ └── TestOrderer.cs │ │ └── ApiTests.UnitTest │ │ ├── ApiRequestBuilder.cs │ │ ├── ApiTests.UnitTest.csproj │ │ ├── DynamoDbOptionsTest.cs │ │ ├── FunctionTest.cs │ │ ├── MockDeleteProductFunctionTests.cs │ │ ├── MockGetProductFunctionTests.cs │ │ ├── MockGetProductsFunctionTests.cs │ │ ├── MockPutProductFunctionTests.cs │ │ └── ServiceExtensions.cs ├── apigw-lambda-list-s3-buckets │ ├── README.md │ ├── ServerlessTestIntro.sln │ ├── img │ │ └── apigw-lambda-list-s3-buckets.png │ ├── metadata.json │ ├── src │ │ ├── ServerlessTestSamples.Core │ │ │ ├── Queries │ │ │ │ ├── ListStorageAreasQuery.cs │ │ │ │ ├── ListStorageAreasQueryHandler.cs │ │ │ │ └── ListStorageAreasQueryResult.cs │ │ │ ├── ServerlessTestSamples.Core.csproj │ │ │ └── Services │ │ │ │ ├── IStorageService.cs │ │ │ │ └── ListStorageAreasResult.cs │ │ ├── ServerlessTestSamples.Integrations │ │ │ ├── S3StorageService.cs │ │ │ ├── ServerlessTestSamples.Integrations.csproj │ │ │ └── Startup.cs │ │ └── ServerlessTestSamples │ │ │ ├── Function.cs │ │ │ └── ServerlessTestSamples.csproj │ ├── template.yaml │ └── tests │ │ ├── ServerlessTestSamples.IntegrationTest │ │ ├── IntegrationTest.cs │ │ ├── ListStorageAreaResponse.cs │ │ ├── ServerlessTestSamples.IntegrationTest.csproj │ │ └── Setup.cs │ │ └── ServerlessTestSamples.UnitTest │ │ ├── MockBusinessLogicTests.cs │ │ ├── MockSdkTests.cs │ │ ├── Models │ │ └── ListStorageAreaResponseBody.cs │ │ └── ServerlessTestSamples.UnitTest.csproj ├── async-lambda-dynamodb │ ├── .gitignore │ ├── AsyncTesting.sln │ ├── README.md │ ├── img │ │ ├── lambda-dynamo.png │ │ └── s3-lambda-s3.png │ ├── metadata.json │ ├── src │ │ └── AsyncTesting.S3EventHandler │ │ │ ├── AsyncTesting.S3EventHandler.csproj │ │ │ └── Function.cs │ ├── template.yaml │ └── tests │ │ ├── AsyncTesting.IntegrationTest │ │ ├── AsyncTesting.IntegrationTest.csproj │ │ ├── Setup.cs │ │ ├── TextTransformerE2ETest.cs │ │ └── Usings.cs │ │ └── AsyncTesting.IntegrationTestListener │ │ ├── AsyncTesting.IntegrationTestListener.csproj │ │ └── Function.cs ├── async-lambda-sqs │ ├── README.md │ ├── async-lambda-sqs.sln │ ├── img │ │ └── s3-lambda-sqs.png │ ├── metadata.json │ ├── src │ │ └── S3Notifications │ │ │ ├── Function.cs │ │ │ ├── S3NotificationMessage.cs │ │ │ ├── S3Notifications.csproj │ │ │ └── aws-lambda-tools-defaults.json │ ├── template.yaml │ ├── tests │ │ ├── S3Notifications.E2ETests │ │ │ ├── Fixtures │ │ │ │ └── S3NotificationEnvironmentFixture.cs │ │ │ ├── FunctionTest.cs │ │ │ └── S3Notifications.E2ETests.csproj │ │ ├── S3Notifications.TestUtilities │ │ │ ├── Builders │ │ │ │ ├── S3BucketEntityBuilder.cs │ │ │ │ ├── S3EntityBuilder.cs │ │ │ │ ├── S3EventNotificationRecordBuilder.cs │ │ │ │ └── S3ObjectEntityBuilder.cs │ │ │ ├── Extensions │ │ │ │ └── SqsExtensions.cs │ │ │ └── S3Notifications.TestUtilities.csproj │ │ ├── S3Notifications.UnitTests │ │ │ ├── FunctionTest.cs │ │ │ ├── S3Notifications.UnitTests.csproj │ │ │ └── Usings.cs │ │ └── S3Notifications.integrationTests │ │ │ ├── Fixtures │ │ │ └── SqsTestFixture.cs │ │ │ ├── FunctionTest.cs │ │ │ ├── S3Notifications.integrationTests.csproj │ │ │ └── Usings.cs │ └── y ├── hexagonal-architecture │ ├── HexagonalArchitecture.sln │ ├── README.md │ ├── img │ │ └── hexagonal-architecture.png │ ├── metadata.json │ ├── src │ │ └── GetStock │ │ │ ├── Adapters │ │ │ ├── AdapterExtensions.cs │ │ │ ├── CurrencyConverterHttpClient.cs │ │ │ ├── Exceptions │ │ │ │ └── StockNotFoundException.cs │ │ │ ├── HttpClientWrapper.cs │ │ │ ├── ICurrencyConverter.cs │ │ │ ├── IHttpClient.cs │ │ │ ├── IServiceConfiguration.cs │ │ │ ├── IStockDB.cs │ │ │ ├── Model │ │ │ │ ├── CurrencyRates.cs │ │ │ │ └── StockData.cs │ │ │ ├── ServiceEnvironmentConfiguration.cs │ │ │ └── StockDynamoDb.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Domains │ │ │ ├── DomainExtensions.cs │ │ │ ├── IStockLogic.cs │ │ │ ├── Models │ │ │ │ └── StockWithCurrencies.cs │ │ │ └── StockLogic.cs │ │ │ ├── Functions.cs │ │ │ ├── GetStock.csproj │ │ │ ├── Ports │ │ │ ├── CurrenciesService.cs │ │ │ ├── HttpHandler.cs │ │ │ ├── PortsExtensions.cs │ │ │ └── Repository.cs │ │ │ └── Utilities │ │ │ └── CollectionUtils.cs │ ├── template.yaml │ └── tests │ │ ├── GetStock.IntegrationTest │ │ ├── Adapters │ │ │ ├── HttpClientTests.cs │ │ │ └── StockDynamoDbTests.cs │ │ ├── Fixtures │ │ │ ├── CloudDynamoDbFixture.cs │ │ │ ├── DynamoDbTestBase.cs │ │ │ ├── HttpClientFixture.cs │ │ │ └── LocalDynamoDbFixture.cs │ │ ├── GetStock.IntegrationTest.csproj │ │ ├── TestUtilities │ │ │ └── TestServiceConfiguration.cs │ │ └── Usings.cs │ │ └── GetStock.UnitTest │ │ ├── Adapters │ │ └── CurrencyConverterTests.cs │ │ ├── Builder │ │ └── APIGatewayProxyRequestBuilder.cs │ │ ├── Domains │ │ └── StockLogicTests.cs │ │ ├── FunctionsTests.cs │ │ ├── GetStock.UnitTest.csproj │ │ └── Usings.cs ├── img │ ├── authors │ │ ├── dror-helper.jpeg │ │ ├── james-eastham.png │ │ └── leslie-daniel-raj.jpeg │ ├── generic-async-system.png │ ├── generic-async-test.png │ └── s3-lambda-s3.png ├── kinesis-lambda-dynamodb │ ├── README.md │ ├── img │ │ ├── kinesis-system-under-test-description.png │ │ └── kinesis-system-under-test.png │ ├── kinesis-lambda-dynamodb.sln │ ├── metadata.json │ ├── omnisharp.json │ ├── src │ │ ├── KinesisEventHandler.Infrastructure │ │ │ ├── KinesisEventHandler.Infrastructure.csproj │ │ │ ├── LambdaContextExtensions.cs │ │ │ └── Startup.cs │ │ ├── KinesisEventHandler.Repositories │ │ │ ├── DynamoDbOptions.cs │ │ │ ├── DynamoDbOptionsValidator.cs │ │ │ ├── EmployeeRepository.cs │ │ │ ├── IDynamoDbRepository.cs │ │ │ ├── KinesisEventHandler.Repositories.csproj │ │ │ ├── Mappers │ │ │ │ ├── EmployeeMapper.cs │ │ │ │ └── UpsertResult.cs │ │ │ └── Models │ │ │ │ └── EmployeeDto.cs │ │ ├── KinesisEventHandler │ │ │ ├── Functions │ │ │ │ └── ProcessEmployeeFunction.cs │ │ │ ├── Handlers │ │ │ │ └── KinesisEventHandler.cs │ │ │ ├── KinesisEventHandler.csproj │ │ │ ├── Models │ │ │ │ ├── Employee.cs │ │ │ │ └── KinesisEventResponse.cs │ │ │ └── aws-lambda-tools-defaults.json │ │ └── template.yaml │ └── tests │ │ ├── KinesisEventHandler.IntegrationTests │ │ ├── KinesisEventHandler.IntegrationTests.csproj │ │ ├── ProcessEmployeeTests.cs │ │ └── Utilities │ │ │ ├── EmployeeBuilder.cs │ │ │ └── ProcessEmployeeFixture.cs │ │ └── KinesisEventHandler.UnitTests │ │ ├── Functions │ │ └── ProcessEmployeeFunctionTests.cs │ │ ├── Handlers │ │ └── KinesisEventHandlerTests.cs │ │ ├── KinesisEventHandler.UnitTests.csproj │ │ └── Utilities │ │ ├── EmployeeBuilder.cs │ │ └── KinesisEventBuilder.cs ├── schema-and-contract-testing │ ├── README.md │ ├── SchemaTesting.sln │ ├── events │ │ ├── event-1.0.0.json │ │ ├── event-1.1.0.json │ │ ├── event-1.2.0.json │ │ ├── event-1.3.0.json │ │ └── event-1.4.0.json │ ├── img │ │ ├── contract_testing.png │ │ └── schema_testing.png │ ├── metadata.json │ ├── schemas │ │ └── json │ │ │ ├── customerCreated-v1.0.0.json │ │ │ ├── customerCreated-v1.1.0.json │ │ │ ├── customerCreated-v1.2.0.json │ │ │ └── customerCreated-v1.3.0.json │ ├── src │ │ ├── CreateCustomerFunction │ │ │ ├── AssemblyInfo.cs │ │ │ ├── CreateCustomerCommand.cs │ │ │ ├── CreateCustomerCommandHandler.cs │ │ │ ├── CreateCustomerCommandResponse.cs │ │ │ ├── CreateCustomerFunction.csproj │ │ │ ├── CustomerCreatedEvent │ │ │ │ ├── CustomerCreatedEventV1.cs │ │ │ │ ├── CustomerCreatedEventV2.cs │ │ │ │ └── CustomerCreatedEventV3.cs │ │ │ ├── Function.cs │ │ │ ├── Startup.cs │ │ │ └── serverless.template │ │ └── SchemaTesting.Shared │ │ │ ├── EventBridgeEventPublisher.cs │ │ │ ├── EventWrapper.cs │ │ │ ├── IEventPublisher.cs │ │ │ └── SchemaTesting.Shared.csproj │ ├── template.yaml │ └── tests │ │ ├── SchemaTesting.SchemaRegistry │ │ ├── ContractTests.cs │ │ ├── CreateCustomerTests.cs │ │ ├── EventBridgeSchemaRegistryReader.cs │ │ ├── EventBusEventOverride.cs │ │ ├── ISchemaReader.cs │ │ ├── SampleEventReader.cs │ │ ├── SchemaTesting.SchemaRegistry.csproj │ │ ├── Setup.cs │ │ └── Usings.cs │ │ └── SchemaTesting.UnitTest │ │ ├── ContractTests.cs │ │ ├── CreateCustomerTests.cs │ │ ├── EventBridgeSchemaRegistryReader.cs │ │ ├── ISchemaReader.cs │ │ ├── LocalDiskSchemaReader.cs │ │ ├── SampleEventReader.cs │ │ ├── SchemaTesting.UnitTest.csproj │ │ ├── SchemaTests.cs │ │ └── Usings.cs ├── sqs-lambda │ ├── README.md │ ├── img │ │ ├── send-message.png │ │ ├── sqs-lambda-sut.png │ │ └── sqs-lambda.png │ ├── metadata.json │ ├── omnisharp.json │ ├── sqs-lambda.sln │ ├── src │ │ ├── SQSEventHandler │ │ │ ├── Functions │ │ │ │ └── ProcessEmployeeFunction.cs │ │ │ ├── Handlers │ │ │ │ └── SqsEventHandler.cs │ │ │ ├── Models │ │ │ │ └── Employee.cs │ │ │ ├── SQSEventHandler.csproj │ │ │ └── aws-lambda-tools-defaults.json │ │ ├── SqsEventHandler.Infrastructure │ │ │ ├── LambdaContextExtensions.cs │ │ │ ├── SqsEventHandler.Infrastructure.csproj │ │ │ └── Startup.cs │ │ ├── SqsEventHandler.Repositories │ │ │ ├── DynamoDbOptions.cs │ │ │ ├── DynamoDbOptionsValidator.cs │ │ │ ├── EmployeeRepository.cs │ │ │ ├── IDynamoDbRepository.cs │ │ │ ├── Mappers │ │ │ │ ├── EmployeeMapper.cs │ │ │ │ └── UpsertResult.cs │ │ │ ├── Models │ │ │ │ └── EmployeeDto.cs │ │ │ └── SqsEventHandler.Repositories.csproj │ │ └── template.yaml │ └── tests │ │ ├── SqsEventHandler.IntegrationTests │ │ ├── ProcessEmployeeTests.cs │ │ ├── SqsEventHandler.IntegrationTests.csproj │ │ └── Utilities │ │ │ ├── EmployeeBuilder.cs │ │ │ ├── PriorityOrderer.cs │ │ │ ├── ProcessEmployeeFixture.cs │ │ │ └── TestPriorityAttribute.cs │ │ └── SqsEventHandler.UnitTests │ │ ├── Functions │ │ └── ProcessEmployeeFunctionTests.cs │ │ ├── Handlers │ │ └── SqsEventHandlerTests.cs │ │ ├── SqsEventHandler.UnitTests.csproj │ │ └── Utilities │ │ ├── EmployeeBuilder.cs │ │ └── SqsEventBuilder.cs └── test-containers │ ├── README.md │ ├── TestContainers.sln │ ├── img │ └── apigw-lambda-ddb.jpg │ ├── metadata.json │ ├── src │ ├── DeleteProduct │ │ ├── DeleteProduct.csproj │ │ ├── Function.cs │ │ └── aws-lambda-tools-defaults.json │ ├── GetProducts │ │ ├── Function.cs │ │ ├── GetProducts.csproj │ │ └── aws-lambda-tools-defaults.json │ ├── PutProduct │ │ ├── Function.cs │ │ ├── PutProduct.csproj │ │ └── aws-lambda-tools-defaults.json │ ├── ServerlessTestApi.Core │ │ ├── IProductsDAO.cs │ │ ├── Product.cs │ │ ├── ProductDTO.cs │ │ ├── ProductWrapper.cs │ │ ├── ServerlessTestApi.Core.csproj │ │ └── UpsertOperation.cs │ ├── ServerlessTestApi.Infrastructure │ │ ├── AssemblyInfo.cs │ │ ├── DataAccess │ │ │ ├── DynamoDbProducts.cs │ │ │ └── ProductMapper.cs │ │ ├── DynamoDbOptions.cs │ │ ├── DynamoDbOptionsValidator.cs │ │ ├── LambdaContextExtensions.cs │ │ └── ServerlessTestApi.Infrastructure.csproj │ └── ServerlessTestApi │ │ ├── Function.cs │ │ ├── ServerlessTestApi.csproj │ │ ├── Startup.cs │ │ ├── aws-lambda-tools-defaults.json │ │ └── serverless.template │ ├── template.yaml │ └── tests │ └── ApiTests.IntegrationTestWithEmulation │ ├── APITestCollection.cs │ ├── ApiRequestBuilder.cs │ ├── ApiTests.IntegrationTestWithEmulation.csproj │ ├── FunctionTest.cs │ ├── MockDeleteProductFunctionTests.cs │ ├── MockGetProductFunctionTests.cs │ ├── MockGetProductsFunctionTests.cs │ ├── MockPutProductFunctionTests.cs │ └── TestStartup.cs ├── java-test-samples ├── .editorconfig ├── README-ASYNC.md ├── README.md ├── apigw-lambda-ddb │ ├── README.md │ ├── TicketsFunction │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── TicketFunction.java │ │ │ │ ├── model │ │ │ │ └── Ticket.java │ │ │ │ └── utils │ │ │ │ └── DDBUtils.java │ │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── DynamoTestUtil.java │ │ │ │ ├── TicketEnd2EndTest.java │ │ │ │ ├── TicketFunctionIntegrationTest.java │ │ │ │ └── TicketFunctionMockTest.java │ │ │ └── resources │ │ │ └── events │ │ │ ├── apigw_request_1.json │ │ │ └── apigw_request_nobody.json │ ├── docs │ │ └── TicketTopology.png │ ├── load-test │ │ ├── load-test-dynamic-data.yml │ │ ├── load-test-static-data.yml │ │ ├── loadTestData.js │ │ ├── package.json │ │ ├── run-load-tests-dynamic-data.sh │ │ ├── run-load-tests-static-data.sh │ │ └── tickets-static-data.csv │ ├── metadata.json │ └── template.yaml ├── apigw-lambda-list-s3-buckets │ ├── README.md │ ├── events │ │ └── event.json │ ├── img │ │ └── xray.JPG │ ├── metadata.json │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── App.java │ │ └── test │ │ │ ├── groovy │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── AppSpecIT.groovy │ │ │ │ ├── AppWithMockSpec.groovy │ │ │ │ └── fixtures │ │ │ │ ├── ApiGwRequestFixtures.groovy │ │ │ │ └── BucketFixtures.groovy │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── AppTest.java │ │ │ │ └── AppWithMockTest.java │ │ │ └── resources │ │ │ └── events │ │ │ ├── apigw_req_s3_buckets_get.json │ │ │ └── apigw_req_s3_buckets_post.json │ └── template.yaml ├── async-lambda-dynamodb │ ├── README.md │ ├── img │ │ ├── lambda-dynamo.png │ │ └── s3-lambda-s3.png │ ├── metadata.json │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── amazon │ │ │ │ └── aws │ │ │ │ └── sample │ │ │ │ ├── ToUpperCaseHandler.java │ │ │ │ └── TransformationHandler.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── amazon │ │ │ └── aws │ │ │ └── sample │ │ │ └── TestAsyncTransformation.java │ └── template.yaml ├── fargate-dynamodb-sync │ ├── README.md │ ├── aws-lambda-python-e2e-tests │ │ ├── README.md │ │ ├── aws-lambda-e2e-tests.yaml │ │ ├── lambda_function.py │ │ ├── report.html │ │ ├── requirements.txt │ │ └── tests │ │ │ ├── assets │ │ │ └── style.css │ │ │ ├── config.yaml │ │ │ ├── create_test.py │ │ │ ├── delete_test.py │ │ │ ├── read_test.py │ │ │ └── update_test.py │ ├── doc │ │ ├── AWS_Lambda.png │ │ ├── Deloitte_logo.png │ │ └── customer_crud_app.png │ ├── load-tests │ │ ├── Loadtest.yaml │ │ └── README.md │ ├── metadata.json │ └── spingboot-with-dynamodb │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── doc │ │ └── customer_crud_app.png │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── amazon │ │ │ │ └── aws │ │ │ │ └── sample │ │ │ │ ├── DynamoDBConfig.java │ │ │ │ ├── SpringDynamodbApplication.java │ │ │ │ ├── controller │ │ │ │ └── CustomerController.java │ │ │ │ ├── dao │ │ │ │ └── CustomerDao.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── model │ │ │ │ ├── Customer.java │ │ │ │ └── CustomerView.java │ │ │ │ ├── service │ │ │ │ ├── CustomerService.java │ │ │ │ └── CustomerServiceImpl.java │ │ │ │ └── sqs │ │ │ │ └── SqsService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── customerDetails.json │ │ │ ├── images │ │ │ ├── ecs_cluster.png │ │ │ └── ecs_task_definition.png │ │ │ └── sampleRequest.json │ │ └── test │ │ └── java │ │ └── com │ │ └── amazon │ │ └── aws │ │ └── sample │ │ ├── controller │ │ └── CustomerControllerTest.java │ │ └── mapper │ │ └── CustomerMapperTest.java ├── fargate-lambda-stepfunction-async │ ├── README.md │ ├── async-sqs-lambda-stepfunction-dynamodb │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── doc │ │ │ ├── ECS_cluster.png │ │ │ ├── ECS_task_definition.png │ │ │ └── async-order-processing.png │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── amazon │ │ │ │ │ └── aws │ │ │ │ │ └── sample │ │ │ │ │ ├── Main.java │ │ │ │ │ ├── advice │ │ │ │ │ └── OrderExceptionHandler.java │ │ │ │ │ ├── controller │ │ │ │ │ └── OrderController.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── OrderRequest.java │ │ │ │ │ └── OrderResponse.java │ │ │ │ │ ├── exception │ │ │ │ │ └── OrderException.java │ │ │ │ │ └── utils │ │ │ │ │ ├── AmazonDynamoDBClientBuilderService.java │ │ │ │ │ ├── AmazonDynamoDBClientServiceImpl.java │ │ │ │ │ ├── DynamoDBConfig.java │ │ │ │ │ └── Uuid.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ ├── java │ │ │ ├── controller │ │ │ │ └── OrderControllerTest.java │ │ │ └── utils │ │ │ │ └── DynamoDBConfigTest.java │ │ │ └── resources │ │ │ ├── order_details.json │ │ │ └── product_details.json │ ├── doc │ │ ├── Deloitte_logo.png │ │ ├── Serverless-async-Test-Architecture.png │ │ └── async-order-processing.png │ ├── integration-test │ │ ├── MyCustomException.py │ │ ├── README.md │ │ ├── lambda_function_cloudwatch.py │ │ ├── lambda_function_s3_upload.py │ │ ├── pocserverless-uc2-integrationTest-cloudwatch.yaml │ │ └── pocserverless-uc2-integrationTest-s3-upload.yaml │ ├── lambda-stepfunction-invoke │ │ ├── .gitignore │ │ ├── README.md │ │ ├── StepFunction │ │ │ └── StepFunctionDynamodb.json │ │ ├── doc │ │ │ ├── Lambda-function.png │ │ │ ├── Step-function.png │ │ │ └── async-arch.png │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── amazon │ │ │ │ └── aws │ │ │ │ └── sample │ │ │ │ └── lambda │ │ │ │ └── SqsLambdaStepFunctionHandler.java │ │ │ └── resources │ │ │ └── config.properties │ └── metadata.json ├── img │ ├── authors │ │ ├── Aruna_Shanubhogue.jpg │ │ ├── Evani_Kranthi.jpg │ │ ├── Harsha_Vardhan_Allena.jpg │ │ ├── Indrajit_Bose.jpg │ │ ├── Ravindra_Palisetti.jpg │ │ ├── Venkatesh_Peddada.jpg │ │ ├── aneel-murari.jpeg │ │ ├── dhiraj-mahapatro.jpg │ │ ├── gustavo-martim.png │ │ ├── khairul-habib.jpeg │ │ ├── matt-ridehalgh.png │ │ └── rahul-popat.jpeg │ ├── generic-async-test.png │ ├── generic.png │ └── s3-lambda-s3.png ├── java-appsync-sam │ ├── README-Cognito.md │ ├── README.md │ ├── appspec.yml │ ├── assets │ │ ├── Architecture-appsync.png │ │ ├── CodePipeline.png │ │ ├── TestingDashboard.png │ │ ├── cloudformation-stack.png │ │ ├── cloudformation-testing.png │ │ ├── schema.png │ │ └── sut.png │ ├── buildspec.yml │ ├── cognito.yaml │ ├── dependency-reduced-pom.xml │ ├── metadata.json │ ├── pipeline.yaml │ ├── pom.xml │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ ├── App.java │ │ │ │ │ ├── DependencyFactory.java │ │ │ │ │ └── Handler.java │ │ │ └── resources │ │ │ │ └── simplelogger.properties │ │ ├── mapping_templates │ │ │ ├── create_booking_request.vtl │ │ │ ├── create_booking_response.vtl │ │ │ ├── create_location_request.vtl │ │ │ ├── create_location_response.vtl │ │ │ ├── create_resource_request.vtl │ │ │ ├── create_resource_response.vtl │ │ │ ├── delete_booking_request.vtl │ │ │ ├── delete_booking_response.vtl │ │ │ ├── delete_location_request.vtl │ │ │ ├── delete_location_response.vtl │ │ │ ├── delete_resource_request.vtl │ │ │ ├── delete_resource_response.vtl │ │ │ ├── get_booking_request.vtl │ │ │ ├── get_booking_response.vtl │ │ │ ├── get_bookings_for_resource_request.vtl │ │ │ ├── get_bookings_for_resource_response.vtl │ │ │ ├── get_bookings_for_user_request.vtl │ │ │ ├── get_bookings_for_user_response.vtl │ │ │ ├── get_location_request.vtl │ │ │ ├── get_location_response.vtl │ │ │ ├── get_locations_request.vtl │ │ │ ├── get_locations_response.vtl │ │ │ ├── get_resource_request.vtl │ │ │ ├── get_resource_response.vtl │ │ │ ├── get_resources_for_location_request.vtl │ │ │ └── get_resources_for_location_response.vtl │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ ├── IntegrationTest.java │ │ │ └── MockTest.java │ ├── template.yaml │ └── testspec.yml ├── schema-and-contract-testing │ ├── .editorconfig │ ├── README.md │ ├── img │ │ ├── contract_testing.png │ │ └── schema_testing.png │ ├── metadata.json │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ ├── App.java │ │ │ └── CustomerValidator.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ ├── BaseJsonSchemaValidatorTest.java │ │ │ ├── ContractTest.java │ │ │ ├── CustomerValidatorTest.java │ │ │ └── SchemaTest.java │ │ └── resources │ │ ├── events │ │ ├── customerCreated-event-1.0.0.json │ │ ├── customerCreated-event-1.1.0.json │ │ ├── customerCreated-event-1.2.0.json │ │ ├── customerCreated-event-1.3.0.json │ │ └── customerCreated-event-1.4.0.json │ │ └── schema │ │ └── json │ │ ├── customerCreated-v1.0.0.json │ │ ├── customerCreated-v1.1.0.json │ │ ├── customerCreated-v1.2.0.json │ │ ├── customerCreated-v1.3.0.json │ │ └── customerCreated-v1.4.0.json └── step-functions-local │ ├── README.md │ ├── images │ └── stepfunctions_local_test.png │ └── metadata.json ├── python-test-samples ├── README-ASYNC.md ├── README.md ├── apigw-lambda-dynamodb │ ├── README.md │ ├── img │ │ ├── diagram.png │ │ ├── sequence.png │ │ └── sequence.uml │ ├── metadata.json │ ├── src │ │ ├── __init__.py │ │ ├── app.py │ │ ├── requirements.txt │ │ └── schemas.py │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ ├── data │ │ ├── events │ │ ├── sampleEvent_Found_TEST001.json │ │ └── sampleEvent_NotFound_TEST002.json │ │ ├── integration │ │ ├── __init__.py │ │ └── test_api_gateway.py │ │ ├── requirements.txt │ │ └── unit │ │ ├── __init__.py │ │ └── mock_test.py ├── apigw-lambda-layer │ ├── README.md │ ├── events │ │ ├── event.json │ │ └── unit-test-event.json │ ├── img │ │ ├── pattern_05_lambda_layer_sut.png │ │ └── pattern_05_lambda_layer_test.jpg │ ├── metadata.json │ ├── src │ │ ├── sampleCodeLayer │ │ │ └── python │ │ │ │ ├── __init__.py │ │ │ │ └── layer.py │ │ ├── sampleLambda │ │ │ ├── __init__.py │ │ │ ├── app.py │ │ │ └── requirements.txt │ │ └── sampleSchemaLayer │ │ │ └── python │ │ │ ├── __init__.py │ │ │ └── schemas.py │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ ├── requirements.txt │ │ └── unit │ │ ├── __init__.py │ │ ├── mock_test_samplecodelayer.py │ │ └── mock_test_samplelambda.py ├── apigw-lambda │ ├── README.md │ ├── events │ │ ├── event.json │ │ └── unit-test-event.json │ ├── img │ │ └── xray.png │ ├── metadata.json │ ├── src │ │ ├── __init__.py │ │ ├── app.py │ │ ├── requirements.txt │ │ └── schemas.py │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ ├── integration │ │ ├── __init__.py │ │ └── test_api_gateway.py │ │ ├── requirements.txt │ │ └── unit │ │ ├── __init__.py │ │ ├── local_emulator_test.py │ │ └── mock_test.py ├── apigw-sqs-lambda-sqs │ ├── README.md │ ├── img │ │ └── architecture.png │ ├── metadata.json │ ├── pytest.ini │ ├── src │ │ ├── process-input-queue │ │ │ ├── process_input_queue.py │ │ │ └── requirements.txt │ │ └── write-test-result │ │ │ ├── requirements.txt │ │ │ └── write_test_result.py │ ├── template.yaml │ └── tests │ │ ├── integration │ │ └── test_api_gatway.py │ │ ├── requirements.txt │ │ └── unit │ │ └── pass_test.py ├── async-lambda-dynamodb │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── img │ │ └── s3-lambda-s3.png │ ├── metadata.json │ ├── src │ │ ├── __init__.py │ │ ├── app.py │ │ └── requirements.txt │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ └── integration │ │ ├── __init__.py │ │ ├── event_listener_lambda.py │ │ ├── requirements.txt │ │ └── test_async_transform.py ├── img │ ├── authors │ │ ├── arthi-jaganathan.jpeg │ │ ├── brian-krygsman.png │ │ ├── dan-fox.jpeg │ │ ├── dan-straw.jpeg │ │ ├── guy-almog.jpeg │ │ ├── katherine-vishnevskaya.jpeg │ │ ├── ramesh-mathikumar.jpeg │ │ ├── tom-romano.jpeg │ │ └── yossi-chai.jpeg │ ├── generic-async-test.png │ ├── generic.png │ ├── lambda-dynamo.png │ └── s3-lambda-s3.png ├── integrated-application-test-kit │ ├── LICENSE │ ├── README.md │ ├── events │ │ ├── 1-prevalidate-event.md │ │ ├── 2-postvalidate-event.md │ │ ├── 3-premetadata-event.md │ │ └── 4-postmetadata-event.md │ ├── img │ │ ├── architecture.png │ │ └── plugin_tester_1.png │ ├── metadata.json │ └── plugins │ │ ├── 1-prevalidate-plugins │ │ └── test-prevalidate-plugin │ │ │ ├── .gitignore │ │ │ ├── events │ │ │ └── valid_event.json │ │ │ ├── functions │ │ │ ├── .npmignore │ │ │ └── app.js │ │ │ ├── package.json │ │ │ ├── plugin.json │ │ │ ├── samconfig.toml │ │ │ ├── template.yaml │ │ │ └── tests │ │ │ └── tester.js │ │ ├── 2-postvalidate-plugins │ │ └── python-minimal-plugin │ │ │ ├── .gitignore │ │ │ ├── __init__.py │ │ │ ├── events │ │ │ └── valid_event.json │ │ │ ├── functions │ │ │ ├── __init__.py │ │ │ ├── app.py │ │ │ └── requirements.txt │ │ │ ├── samconfig.toml │ │ │ ├── template.yaml │ │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── integration │ │ │ ├── __init__.py │ │ │ ├── test_by_polling.py │ │ │ ├── test_by_polling_with_registry.py │ │ │ ├── test_by_waiting.py │ │ │ └── test_trace.py │ │ │ └── requirements.txt │ │ ├── 3-premetadata-plugins │ │ └── .gitkeep │ │ ├── 4-postmetadata-plugins │ │ └── .gitkeep │ │ └── plugin_tester │ │ ├── code │ │ ├── app.js │ │ └── package.json │ │ ├── event.json │ │ ├── samconfig.toml │ │ ├── template.yaml │ │ └── workflow │ │ └── statemachine.asl.json ├── kinesis-lambda-dynamodb │ ├── README.md │ ├── img │ │ ├── integration-test-description.png │ │ ├── system-under-test-description.png │ │ ├── system-under-test.png │ │ └── unit-test-description.png │ ├── metadata.json │ ├── src │ │ ├── __init__.py │ │ ├── app.py │ │ ├── requirements.txt │ │ └── schemas.py │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ ├── data │ │ ├── events │ │ └── sample_test_event.json │ │ ├── integration │ │ ├── __init__.py │ │ └── test_kinesis.py │ │ ├── requirements.txt │ │ └── unit │ │ ├── __init__.py │ │ ├── mock_test.py │ │ └── sample_test_event.json ├── lambda-mock │ ├── Makefile │ ├── README.md │ ├── doc │ │ ├── architecture.png │ │ └── pattern_04_lambda_mock_test.png │ ├── metadata.json │ ├── src │ │ └── sample_lambda │ │ │ ├── __init__.py │ │ │ ├── app.py │ │ │ ├── requirements.txt │ │ │ └── schemas.py │ ├── template.yaml │ └── tests │ │ ├── __init__.py │ │ ├── events │ │ └── sampleEvent1.json │ │ ├── requirements.txt │ │ └── unit │ │ ├── __init__.py │ │ └── src │ │ ├── __init__.py │ │ └── test_sample_lambda.py ├── schema-and-contract-testing │ ├── .gitignore │ ├── README.md │ ├── events │ │ ├── customerCreated-event-1.0.0.json │ │ ├── customerCreated-event-1.1.0.json │ │ ├── customerCreated-event-1.2.0.json │ │ ├── customerCreated-event-1.3.0.json │ │ └── customerCreated-event-1.4.0.json │ ├── img │ │ ├── contract_testing.png │ │ └── schema_testing.png │ ├── metadata.json │ ├── requirements.txt │ ├── schema │ │ └── json │ │ │ ├── customerCreated-v1.0.0.json │ │ │ ├── customerCreated-v1.1.0.json │ │ │ ├── customerCreated-v1.2.0.json │ │ │ ├── customerCreated-v1.3.0.json │ │ │ └── customerCreated-v1.4.0.json │ ├── src │ │ ├── __init__.py │ │ ├── customer_v1_0_0.py │ │ ├── customer_v1_0_0_with_validation.py │ │ ├── customer_v1_1_0.py │ │ ├── customer_v1_2_0.py │ │ ├── customer_v1_3_0.py │ │ └── customer_v1_4_0.py │ └── tests │ │ ├── __init__.py │ │ ├── context.py │ │ ├── test_contract.py │ │ └── test_schema.py └── step-functions-local │ ├── README.md │ ├── img │ ├── stepfunctions_local_test.png │ └── system-under-test-description.png │ ├── metadata.json │ ├── statemachine │ ├── local_testing.asl.json │ └── test │ │ ├── MockConfigFile.json │ │ └── valid_input.json │ └── tests │ ├── requirements.txt │ └── unit │ └── src │ └── test_step_functions_local.py ├── typescript-test-samples ├── README-ASYNC.md ├── README.md ├── apigw-lambda-dynamodb │ ├── .gitignore │ ├── README.md │ ├── env.json │ ├── img │ │ ├── sequence.png │ │ ├── sequence.uml │ │ ├── system-under-test-description.png │ │ └── system-under-test.png │ ├── metadata.json │ ├── src │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .npmignore │ │ ├── .prettierrc.js │ │ ├── app.ts │ │ ├── events │ │ │ └── event-data.ts │ │ ├── jest.config.ts │ │ ├── jest.integration.config.ts │ │ ├── jest.unit.config.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── tests │ │ │ ├── integration │ │ │ │ └── integ-handler.test.ts │ │ │ └── unit │ │ │ │ └── test-handler.test.ts │ │ └── tsconfig.json │ └── template.yaml ├── apigw-lambda-external │ ├── .gitignore │ ├── README.md │ ├── env.json │ ├── img │ │ ├── system-under-test-description.png │ │ └── system-under-test.png │ ├── metadata.json │ ├── src │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .npmignore │ │ ├── .prettierrc.js │ │ ├── app.ts │ │ ├── events │ │ │ └── event-data.ts │ │ ├── jest.config.ts │ │ ├── jest.integration.config.ts │ │ ├── jest.unit.config.ts │ │ ├── package.json │ │ ├── tests │ │ │ ├── integration │ │ │ │ └── integration-handler.test.ts │ │ │ └── unit │ │ │ │ └── test-handler.test.ts │ │ └── tsconfig.json │ └── template.yaml ├── apigw-lambda-sqs-sns-datadog │ ├── README.md │ ├── bin │ │ └── apigw-lambda-sqs-sns-datadog.ts │ ├── cdk.json │ ├── images │ │ ├── architecture.png │ │ ├── capture_payload.png │ │ ├── cold_start_traces.png │ │ ├── flamegraph.png │ │ ├── monitor.png │ │ ├── monitor_service.png │ │ ├── new_monitor.png │ │ ├── new_synthetic_test.png │ │ ├── sns_sqs.png │ │ ├── successful_synthetic_test.png │ │ ├── synthetic_test.png │ │ ├── synthetics_assertion.png │ │ └── synthetics_test_menu_item.png │ ├── jest.config.js │ ├── lib │ │ └── apigw-lambda-sqs-sns-datadog-stack.ts │ ├── metadata.json │ ├── package-lock.json │ ├── package.json │ ├── resources │ │ ├── delay.ts │ │ ├── publisher.ts │ │ └── worker.ts │ └── tsconfig.json ├── appsync-cognito-lambda-aleios │ ├── .prettierrc.js │ ├── README.md │ ├── bin │ │ └── appsync-cognito-lambda.ts │ ├── cdk.json │ ├── env.template │ ├── functions │ │ └── get-random-message │ │ │ └── handler.ts │ ├── images │ │ └── architecture.png │ ├── jest.config.ts │ ├── jest.integration.config.ts │ ├── lib │ │ ├── schema.graphql │ │ └── stack.ts │ ├── metadata.json │ ├── package.json │ ├── tests │ │ ├── helpers │ │ │ └── cognito │ │ │ │ ├── delete-user.ts │ │ │ │ ├── get-token.ts │ │ │ │ ├── index.ts │ │ │ │ └── sign-up.ts │ │ └── integration │ │ │ └── integration-handler.test.ts │ └── tsconfig.json ├── async-lambda-dynamodb │ ├── .gitignore │ ├── README.md │ ├── img │ │ └── s3-lambda-s3.png │ ├── metadata.json │ ├── src │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .npmignore │ │ ├── .prettierrc.js │ │ ├── app.ts │ │ ├── jest.config.ts │ │ ├── jest.integration.config.ts │ │ ├── jest.unit.config.ts │ │ ├── package.json │ │ ├── tests │ │ │ └── integration │ │ │ │ ├── event_listener_lambda.ts │ │ │ │ ├── package.json │ │ │ │ └── test_async_transform.test.ts │ │ └── tsconfig.json │ └── template.yaml ├── img │ ├── authors │ │ ├── aaron-stuyvenberg.jpeg │ │ ├── aiden-walton.png │ │ ├── arthi-jaganathan.jpeg │ │ ├── brian-krygsman.jpeg │ │ ├── brian-rinaldi.jpeg │ │ ├── chanki-nathani.jpeg │ │ ├── debasis-mitra.jpeg │ │ ├── jordi-macia.jpeg │ │ ├── katherine-vishnevskaya.jpeg │ │ ├── mark-white.jpeg │ │ └── richard-vidis.jpeg │ ├── generic-async-system.png │ ├── generic-async-test.png │ ├── lambda-dynamo.png │ └── s3-lambda-s3.png ├── kinesis-lambda-dynamodb │ ├── .gitignore │ ├── README.md │ ├── img │ │ ├── integration-test-description.png │ │ ├── system-under-test-description.png │ │ ├── system-under-test.png │ │ └── unit-test-description.png │ ├── metadata.json │ ├── src │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .npmignore │ │ ├── .prettierrc.js │ │ ├── app.ts │ │ ├── events │ │ │ └── unit-test-event.json │ │ ├── jest.config.ts │ │ ├── jest.integration.config.ts │ │ ├── jest.unit.config.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── tests │ │ │ ├── integration │ │ │ │ ├── appTest.ts │ │ │ │ ├── integ-handler.test.ts │ │ │ │ └── package.json │ │ │ └── unit │ │ │ │ └── test-handler.test.ts │ │ └── tsconfig.json │ └── template.yaml ├── lambda-handler-dynamodb │ ├── .gitignore │ ├── .npmignore │ ├── README.md │ ├── bin │ │ └── lambda-handler-dynamodb.ts │ ├── cdk.json │ ├── env.json │ ├── img │ │ ├── pattern_02_lambda_handler_test.png │ │ └── system-under-test.png │ ├── jest.config.js │ ├── lib │ │ └── lambda-handler-dynamodb-stack.ts │ ├── metadata.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app.ts │ │ └── events │ │ │ └── event-data.ts │ ├── test │ │ └── integration │ │ │ └── integ-handler.test.ts │ └── tsconfig.json ├── launchdarkly-lambda-dynamodb │ ├── README.md │ ├── cdk │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── bin │ │ │ └── cdk.js │ │ ├── cdk.json │ │ ├── jest.config.js │ │ ├── lib │ │ │ └── cdk-stack.js │ │ ├── package.json │ │ └── resources │ │ │ ├── lambdas │ │ │ ├── getFlagsStarter │ │ │ │ ├── index.mjs │ │ │ │ └── index.ts │ │ │ ├── getFlagsWithDynamo │ │ │ │ ├── index.mjs │ │ │ │ └── index.ts │ │ │ └── syncFlagsToDynamo │ │ │ │ ├── index.mjs │ │ │ │ └── index.ts │ │ │ └── layers │ │ │ └── .gitkeep │ ├── create-layer │ │ ├── index.js │ │ ├── nodejs │ │ │ └── package.json │ │ └── package.json │ ├── img │ │ └── LaunchDarkly-AWS-diagram.png │ └── metadata.json ├── schema-and-contract-testing │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── .prettierrc.js │ ├── README.md │ ├── events │ │ ├── event-1.0.0.json │ │ ├── event-1.1.0.json │ │ ├── event-1.2.0.json │ │ ├── event-1.3.0.json │ │ └── event-1.4.0.json │ ├── img │ │ ├── contract_testing.png │ │ └── schema_testing.png │ ├── jest.config.ts │ ├── metadata.json │ ├── package-lock.json │ ├── package.json │ ├── schemas │ │ └── json │ │ │ ├── customerCreated-v1.0.0.json │ │ │ ├── customerCreated-v1.1.0.json │ │ │ ├── customerCreated-v1.2.0.json │ │ │ └── customerCreated-v1.3.0.json │ ├── src │ │ └── address-validation.ts │ ├── tests │ │ ├── contract-testing.test.ts │ │ └── schema-testing.test.ts │ └── tsconfig.json ├── step-functions-local │ ├── .gitignore │ ├── README.md │ ├── events │ │ └── sfn_valid_input.json │ ├── images │ │ ├── stepfunctions_local_test.png │ │ └── system-under-test-description.png │ ├── metadata.json │ ├── src │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .npmignore │ │ ├── .prettierrc.js │ │ ├── jest.config.ts │ │ ├── jest.sfnLocal.config.ts │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── tests │ │ │ └── sfnLocal │ │ │ │ ├── step-functions-constants.ts │ │ │ │ └── step-functions-local.test.ts │ │ └── tsconfig.json │ └── statemachine │ │ ├── local_testing.asl.json │ │ └── test │ │ └── MockConfigFile.json └── typescript-test-intro │ ├── .gitignore │ ├── README.md │ ├── events │ ├── event.json │ └── unit-test-event.json │ ├── img │ └── system-under-test.png │ ├── list-buckets │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .npmignore │ ├── .prettierrc.js │ ├── app.ts │ ├── jest.config.ts │ ├── jest.integration.config.ts │ ├── jest.unit.config.ts │ ├── package-lock.json │ ├── package.json │ ├── tests │ │ ├── integration │ │ │ └── api.test.ts │ │ └── unit │ │ │ └── list-buckets.test.ts │ └── tsconfig.json │ ├── metadata.json │ └── template.yaml └── workshops ├── README.md └── serverless-testing-workshop ├── Dockerfile ├── Makefile ├── README.md ├── _img └── App_Architecture.png ├── demo-app ├── _img │ └── unicorn_art.md ├── config-orig.json ├── config.toml.cloud9only ├── data │ └── demo-data.csv ├── requirements.txt └── urs-ui.py ├── java └── unicorn-reservation-system │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── myorg │ │ └── urs │ │ └── App.java │ └── test │ └── java │ └── com │ └── myorg │ └── urs │ └── integration │ ├── TestFileProcessor.java │ └── TestLocations.java ├── src ├── Checkout │ ├── app.py │ ├── requirements.txt │ └── schemas.py ├── CreateLocations │ ├── app.py │ └── requirements.txt ├── FileProcessor │ └── StateMachine.asl.json ├── FileValidator │ ├── app.py │ ├── requirements.txt │ └── schemas.py ├── GetInventory │ ├── app.py │ ├── requirements.txt │ └── schemas.py ├── GetLocations │ ├── app.py │ ├── requirements.txt │ └── schemas.py └── GetSignedUrlForInventoryFilePost │ ├── app.py │ ├── requirements.txt │ └── schemas.py ├── template.yaml └── tests ├── events ├── Checkout-sample-event.json ├── fv_test.json └── sampleEvent.json ├── integration ├── dotnet │ ├── .editorconfig │ ├── .gitignore │ ├── UnicornReservationSystem.Tests.Integration.sln │ ├── UnicornReservationSystem.Tests.Integration │ │ ├── FileProcessorTests.cs │ │ ├── Fixtures │ │ │ ├── EnvironmentCollection.cs │ │ │ ├── EnvironmentFixture.cs │ │ │ └── LocationFixture.cs │ │ ├── LocationTests.cs │ │ └── UnicornReservationSystem.Tests.Integration.csproj │ └── completed-solution │ │ ├── .gitignore │ │ ├── UnicornReservationSystem.Tests.Integration.sln │ │ └── UnicornReservationSystem.Tests.Integration │ │ ├── FileProcessorTests.cs │ │ ├── Fixtures │ │ ├── EnvironmentCollection.cs │ │ ├── EnvironmentFixture.cs │ │ └── LocationFixture.cs │ │ ├── LocationTests.cs │ │ └── UnicornReservationSystem.Tests.Integration.csproj └── src │ ├── test_file_processor.py │ └── test_locations.py ├── requirements.txt └── unit └── src └── test_checkout.py /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dancfox 2 | 3 | /typescript-test-samples/ @brnkrygs 4 | /python-test-samples/ @wtromano-aws @dancfox 5 | /java-test-samples/ @dmahapatro @poprahul 6 | /dotnet-test-samples/ @jeastham1993 @dhelper 7 | -------------------------------------------------------------------------------- /.github/metadata/requirements.txt: -------------------------------------------------------------------------------- 1 | fastjsonschema 2 | PyGithub 3 | aws_lambda_powertools 4 | jmespath -------------------------------------------------------------------------------- /.github/workflows/getPatternFolder.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import github_action_utils as gha_utils 4 | 5 | # Read the command-line argument passed to the interpreter when invoking the script 6 | files = sys.argv[1] 7 | 8 | fileList= files.split(",") 9 | 10 | folders = {} 11 | foldersOutput = "" 12 | for file in fileList: 13 | #print(file) 14 | folder = "/".join(file.split("/", 2)[:2]) + "/" 15 | if folder not in foldersOutput: 16 | if (len(foldersOutput) > 0): 17 | foldersOutput += " " 18 | foldersOutput += folder 19 | print(foldersOutput) 20 | gha_utils.set_output("folders", foldersOutput) -------------------------------------------------------------------------------- /.github/workflows/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/.github/workflows/requirements.txt -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /_img/main_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/_img/main_header.png -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/img/apigw-lambda-ddb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/apigw-lambda-ddb/img/apigw-lambda-ddb.jpg -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/DeleteProduct/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "DeleteProduct::DeleteProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/GetProduct/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "GetProduct::GetProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/GetProducts/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "GetProducts::GetProducts.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/PutProduct/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "PutProduct::PutProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Core/DataAccess/IProductsDAO.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using ServerlessTestApi.Core.Models; 4 | 5 | namespace ServerlessTestApi.Core.DataAccess; 6 | 7 | public interface IProductsDao 8 | { 9 | Task GetProduct(string id, CancellationToken cancellationToken); 10 | 11 | Task PutProduct(Product product, CancellationToken cancellationToken); 12 | 13 | Task DeleteProduct(string id, CancellationToken cancellationToken); 14 | 15 | Task GetAllProducts(CancellationToken cancellationToken); 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Core/DataAccess/UpsertOperation.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestApi.Core.DataAccess; 2 | 3 | public enum UpsertResult 4 | { 5 | Inserted, 6 | Updated, 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Core/Models/ProductDTO.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestApi.Core.Models; 2 | 3 | public record ProductDTO 4 | { 5 | public ProductDTO() 6 | { 7 | } 8 | 9 | public ProductDTO(string id, string name, decimal price) 10 | { 11 | Id = id; 12 | Name = name; 13 | Price = price; 14 | } 15 | 16 | public string Id { get; init; } 17 | 18 | public string Name { get; init; } 19 | 20 | public decimal Price { get; init; } 21 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Core/Models/ProductWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ServerlessTestApi.Core.Models; 4 | 5 | public class ProductWrapper 6 | { 7 | public ProductWrapper(List products) => Products = products; 8 | 9 | public List Products { get; } 10 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Core/ServerlessTestApi.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | ServerlessTestApi.Core 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Infrastructure/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Amazon.Lambda.Core; 2 | 3 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Infrastructure/DynamoDbOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace ServerlessTestApi.Infrastructure; 4 | 5 | public class DynamoDbOptions 6 | { 7 | [ConfigurationKeyName("PRODUCT_TABLE_NAME")] 8 | public string ProductTableName { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/src/ServerlessTestApi.Infrastructure/DynamoDbOptionsValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace ServerlessTestApi.Infrastructure; 4 | 5 | public class DynamoDbOptionsValidator : IValidateOptions 6 | { 7 | public ValidateOptionsResult Validate(string? name, DynamoDbOptions options) 8 | { 9 | if (name == Options.DefaultName) 10 | { 11 | if (string.IsNullOrEmpty(options.ProductTableName)) 12 | { 13 | ValidateOptionsResult.Fail("The PRODUCT_TABLE_NAME setting has not been configured"); 14 | } 15 | 16 | return ValidateOptionsResult.Success; 17 | } 18 | 19 | return ValidateOptionsResult.Skip; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/tests/ApiTests.IntegrationTest/Drivers/Product.cs: -------------------------------------------------------------------------------- 1 | namespace ApiTests.IntegrationTest.Drivers 2 | { 3 | public class Product 4 | { 5 | public Product(string id, string name, decimal price) 6 | { 7 | Id = id; 8 | Name = name; 9 | Price = price; 10 | } 11 | 12 | public string Id { get; set; } 13 | 14 | public string Name { get; set; } 15 | 16 | public decimal Price { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/tests/ApiTests.IntegrationTest/Drivers/ProductWrapper.cs: -------------------------------------------------------------------------------- 1 | namespace ApiTests.IntegrationTest.Drivers 2 | { 3 | public class ProductWrapper 4 | { 5 | public ProductWrapper(List products) => Products = products; 6 | 7 | public List Products { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/tests/ApiTests.IntegrationTest/TestOrderAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace ApiTests.IntegrationTest; 2 | 3 | // REF: https://github.com/xunit/samples.xunit/blob/main/TestOrderExamples/TestCaseOrdering/TestPriorityAttribute.cs 4 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 5 | public sealed class TestOrderAttribute : Attribute 6 | { 7 | public TestOrderAttribute(int order) => Order = order; 8 | 9 | public int Order { get; } 10 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/tests/ApiTests.UnitTest/DynamoDbOptionsTest.cs: -------------------------------------------------------------------------------- 1 | using FluentAssertions; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Options; 4 | using ServerlessTestApi.Infrastructure; 5 | 6 | namespace ApiTests.UnitTest; 7 | 8 | public class DynamoDbOptionsTest 9 | { 10 | [Fact] 11 | public void DynamoDbOptions_ShouldHaveDefaultTableName() 12 | { 13 | // arrange 14 | var services = new ServiceCollection(); 15 | 16 | Startup.AddDefaultServices(services); 17 | 18 | using var provider = services.BuildServiceProvider(); 19 | 20 | // act 21 | var options = provider.GetRequiredService>().Value; 22 | 23 | // assert 24 | options.ProductTableName.Should().Be("Products"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-ddb/tests/ApiTests.UnitTest/FunctionTest.cs: -------------------------------------------------------------------------------- 1 | using Amazon.XRay.Recorder.Core; 2 | using Microsoft.Extensions.Logging; 3 | using Microsoft.Extensions.Options; 4 | using System.Text.Json; 5 | using FakeItEasy; 6 | 7 | namespace ApiTests.UnitTest; 8 | 9 | public abstract class FunctionTest 10 | { 11 | protected FunctionTest() 12 | { 13 | // Required for the XRay tracing sub-segment code in the Lambda function handler. 14 | AWSXRayRecorder.InitializeInstance(); 15 | AWSXRayRecorder.Instance.BeginSegment("UnitTests"); 16 | } 17 | 18 | protected IOptions JsonOptions { get; } = 19 | Options.Create(new JsonSerializerOptions(JsonSerializerDefaults.Web)); 20 | 21 | protected ILogger Logger { get; } = A.Fake>(); 22 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/img/apigw-lambda-list-s3-buckets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/apigw-lambda-list-s3-buckets/img/apigw-lambda-list-s3-buckets.png -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/src/ServerlessTestSamples.Core/Queries/ListStorageAreasQuery.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.Core.Queries; 2 | 3 | public class ListStorageAreasQuery 4 | { 5 | public string? FilterPrefix { get; set; } 6 | } 7 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/src/ServerlessTestSamples.Core/Queries/ListStorageAreasQueryResult.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.Core.Queries; 2 | 3 | public class ListStorageAreasQueryResult 4 | { 5 | public ListStorageAreasQueryResult(IEnumerable storageAreas) => StorageAreas = storageAreas; 6 | 7 | public IEnumerable StorageAreas { get; } 8 | } 9 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/src/ServerlessTestSamples.Core/ServerlessTestSamples.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/src/ServerlessTestSamples.Core/Services/IStorageService.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.Core.Services; 2 | 3 | public interface IStorageService 4 | { 5 | Task ListStorageAreas(string? filterPrefix, CancellationToken cancellationToken); 6 | } -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/src/ServerlessTestSamples.Core/Services/ListStorageAreasResult.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.Core.Services; 2 | 3 | public record ListStorageAreasResult(IEnumerable StorageAreas, bool IsSuccess = true, string Message = ""); -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/tests/ServerlessTestSamples.IntegrationTest/ListStorageAreaResponse.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.IntegrationTest.Drivers; 2 | 3 | public record ListStorageAreasResult(IEnumerable StorageAreas, bool IsSuccess = true, string Message = ""); -------------------------------------------------------------------------------- /dotnet-test-samples/apigw-lambda-list-s3-buckets/tests/ServerlessTestSamples.UnitTest/Models/ListStorageAreaResponseBody.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestSamples.UnitTest.Models; 2 | 3 | public record ListStorageAreaResponseBody 4 | { 5 | public IEnumerable StorageAreas { get; set; } = Enumerable.Empty(); 6 | } -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-dynamodb/img/lambda-dynamo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/async-lambda-dynamodb/img/lambda-dynamo.png -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-dynamodb/tests/AsyncTesting.IntegrationTest/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/img/s3-lambda-sqs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/async-lambda-sqs/img/s3-lambda-sqs.png -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/src/S3Notifications/S3NotificationMessage.cs: -------------------------------------------------------------------------------- 1 | namespace S3Notifications; 2 | 3 | public record S3NotificationMessage(string BucketName, string ObjectKey, string EventName); 4 | -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/src/S3Notifications/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "dhelper@isenguard", 9 | "region": "us-east-1", 10 | "configuration": "Release", 11 | "s3-prefix": "async-lambda-sqs/", 12 | "template": "serverless.template", 13 | "template-parameters": "" 14 | } -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/tests/S3Notifications.TestUtilities/S3Notifications.TestUtilities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/tests/S3Notifications.UnitTests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/tests/S3Notifications.integrationTests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /dotnet-test-samples/async-lambda-sqs/y: -------------------------------------------------------------------------------- 1 | version = 0.1 2 | [default] 3 | [default.deploy] 4 | [default.deploy.parameters] 5 | stack_name = "async-lambda-sqs" 6 | s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-5ruvmo7mr720" 7 | s3_prefix = "async-lambda-sqs" 8 | region = "us-east-1" 9 | confirm_changeset = true 10 | capabilities = "CAPABILITY_IAM" 11 | parameter_overrides = "BucketName=\"lambda-monitored\"" 12 | image_repositories = [] 13 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/img/hexagonal-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/hexagonal-architecture/img/hexagonal-architecture.png -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/AdapterExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace GetStock.Adapters; 4 | 5 | public static class AdapterExtensions 6 | { 7 | public static void AddAdapters(this IServiceCollection services) 8 | { 9 | services.AddSingleton(); 10 | services.AddSingleton(); 11 | services.AddSingleton(); 12 | services.AddSingleton(); 13 | } 14 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/Exceptions/StockNotFoundException.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters.Exceptions; 2 | 3 | public class StockNotFoundException : Exception 4 | { 5 | public StockNotFoundException() 6 | { 7 | 8 | } 9 | public StockNotFoundException(string stockId) : base($"Stock {stockId} not found") 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/ICurrencyConverter.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters 2 | { 3 | public interface ICurrencyConverter 4 | { 5 | Task> GetCurrencies(string baseCurrency, IEnumerable currencies); 6 | } 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/IHttpClient.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters; 2 | 3 | public interface IHttpClient : IDisposable 4 | { 5 | Task GetAsync(string url); 6 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/IServiceConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters 2 | { 3 | public interface IServiceConfiguration 4 | { 5 | string CurrencyBaseAddress { get; } 6 | string DynamoDbTableName { get; } 7 | string CurrencyApiKey { get; } 8 | } 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/IStockDB.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Adapters.Model; 2 | 3 | namespace GetStock.Adapters 4 | { 5 | public interface IStockDB 6 | { 7 | Task GetStockValueAsync(string stockId); 8 | } 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/Model/CurrencyRates.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace GetStock.Adapters.Model; 4 | 5 | internal class CurrencyRates 6 | { 7 | [JsonPropertyName("base")] 8 | public string Base { get; set; } 9 | 10 | [JsonPropertyName("date")] 11 | public string Date { get; set; } 12 | 13 | [JsonPropertyName("rates")] 14 | public Dictionary Rates { get; set; } 15 | 16 | [JsonPropertyName("success")] 17 | public bool Success { get; set; } 18 | 19 | [JsonPropertyName("timestamp")] 20 | public int Timestamp { get; set; } 21 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/Model/StockData.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters.Model; 2 | 3 | public record StockData 4 | { 5 | public string StockId { get; set; } = null!; 6 | public double Value { get; set; } 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Adapters/ServiceEnvironmentConfiguration.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Adapters 2 | { 3 | internal class ServiceEnvironmentConfiguration : IServiceConfiguration 4 | { 5 | public string DynamoDbTableName => Environment.GetEnvironmentVariable("DB_TABLE"); 6 | public string CurrencyBaseAddress => Environment.GetEnvironmentVariable("BASE_API"); 7 | public string CurrencyApiKey => Environment.GetEnvironmentVariable("API_KEY"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Amazon.Lambda.Core; 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] 5 | [assembly: InternalsVisibleTo("GetStock.UnitTest")] 6 | [assembly: InternalsVisibleTo("GetStock.IntegrationTest")] 7 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Domains/DomainExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace GetStock.Domains; 4 | 5 | public static class DomainExtensions 6 | { 7 | public static void AddDomainServices(this IServiceCollection services) 8 | { 9 | services.AddSingleton(); 10 | } 11 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Domains/IStockLogic.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Domains.Models; 2 | 3 | namespace GetStock.Domains; 4 | 5 | public interface IStockLogic 6 | { 7 | Task RetrieveStockValuesAsync(string stockId); 8 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Ports/CurrenciesService.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Adapters; 2 | 3 | namespace GetStock.Ports 4 | { 5 | internal class CurrenciesService 6 | { 7 | private readonly ICurrencyConverter _currencyConverter; 8 | 9 | public CurrenciesService(ICurrencyConverter currencyConverter) 10 | { 11 | _currencyConverter = currencyConverter; 12 | } 13 | 14 | public async Task> GetCurrencyDataAsync(string baseCurrency, IEnumerable currencies) 15 | { 16 | return await _currencyConverter.GetCurrencies(baseCurrency, currencies); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Ports/PortsExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | 3 | namespace GetStock.Ports; 4 | 5 | public static class PortsExtensions 6 | { 7 | public static void AddPortsServices(this IServiceCollection services) 8 | { 9 | services.AddSingleton(); 10 | services.AddSingleton(); 11 | services.AddSingleton(); 12 | } 13 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Ports/Repository.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Adapters; 2 | 3 | namespace GetStock.Ports; 4 | 5 | internal class Repository 6 | { 7 | private readonly IStockDB _stockDb; 8 | 9 | public Repository(IStockDB stockDb) 10 | { 11 | _stockDb = stockDb; 12 | } 13 | 14 | public async Task GetStockValueAsync(string stockId) 15 | { 16 | var stockData = await _stockDb.GetStockValueAsync(stockId); 17 | 18 | return stockData.Value; 19 | } 20 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/src/GetStock/Utilities/CollectionUtils.cs: -------------------------------------------------------------------------------- 1 | namespace GetStock.Utilities 2 | { 3 | public static class CollectionUtils 4 | { 5 | public static KeyValuePair ToPair(TKey key, TValue value) 6 | { 7 | return new KeyValuePair(key, value); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/tests/GetStock.IntegrationTest/Fixtures/CloudDynamoDbFixture.cs: -------------------------------------------------------------------------------- 1 | using Amazon; 2 | using Amazon.DynamoDBv2; 3 | 4 | namespace GetStock.IntegrationTest.Fixtures 5 | { 6 | public class CloudDynamoDbFixture 7 | { 8 | public IAmazonDynamoDB Client { get; } 9 | private static readonly RegionEndpoint DbRegion = RegionEndpoint.USEast1; 10 | 11 | public CloudDynamoDbFixture() 12 | { 13 | Client = new AmazonDynamoDBClient(DbRegion); 14 | } 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/tests/GetStock.IntegrationTest/Fixtures/HttpClientFixture.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Adapters; 2 | using GetStock.IntegrationTest.TestUtilities; 3 | 4 | namespace GetStock.IntegrationTest.Fixtures; 5 | 6 | public class HttpClientFixture : IDisposable 7 | { 8 | public IHttpClient Client { get; } 9 | public HttpClientFixture() 10 | { 11 | var configuration = new TestServiceConfiguration 12 | { 13 | //TODO: insert API key from https://fixer.io/ 14 | CurrencyApiKey = "", 15 | CurrencyBaseAddress = "https://api.apilayer.com/fixer/latest" 16 | }; 17 | 18 | Client = new HttpClientWrapper(configuration); 19 | } 20 | 21 | public void Dispose() 22 | { 23 | Client.Dispose(); 24 | } 25 | } -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/tests/GetStock.IntegrationTest/TestUtilities/TestServiceConfiguration.cs: -------------------------------------------------------------------------------- 1 | using GetStock.Adapters; 2 | 3 | namespace GetStock.IntegrationTest.TestUtilities 4 | { 5 | public class TestServiceConfiguration : IServiceConfiguration 6 | { 7 | public string CurrencyBaseAddress { get; set; } = "http://dummy.url"; 8 | 9 | public string DynamoDbTableName { get; set; } = "test-currencies"; 10 | 11 | public string CurrencyApiKey { get; set; } = "api-key"; 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/tests/GetStock.IntegrationTest/Usings.cs: -------------------------------------------------------------------------------- 1 | //#define RUN_LOCAL_DB 2 | 3 | #if RUN_LOCAL_DB 4 | global using DynamoDbFixture = GetStock.IntegrationTest.Fixtures.LocalDynamoDbFixture; 5 | #else 6 | global using DynamoDbFixture = GetStock.IntegrationTest.Fixtures.CloudDynamoDbFixture; 7 | #endif 8 | 9 | global using Xunit; -------------------------------------------------------------------------------- /dotnet-test-samples/hexagonal-architecture/tests/GetStock.UnitTest/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; 2 | global using FakeItEasy; 3 | global using Autofac.Extras.FakeItEasy; 4 | global using FluentAssertions; -------------------------------------------------------------------------------- /dotnet-test-samples/img/authors/dror-helper.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/authors/dror-helper.jpeg -------------------------------------------------------------------------------- /dotnet-test-samples/img/authors/james-eastham.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/authors/james-eastham.png -------------------------------------------------------------------------------- /dotnet-test-samples/img/authors/leslie-daniel-raj.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/authors/leslie-daniel-raj.jpeg -------------------------------------------------------------------------------- /dotnet-test-samples/img/generic-async-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/generic-async-system.png -------------------------------------------------------------------------------- /dotnet-test-samples/img/generic-async-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/generic-async-test.png -------------------------------------------------------------------------------- /dotnet-test-samples/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/img/kinesis-system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/kinesis-lambda-dynamodb/img/kinesis-system-under-test-description.png -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/img/kinesis-system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/kinesis-lambda-dynamodb/img/kinesis-system-under-test.png -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/omnisharp.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileOptions": { 3 | "excludeSearchPatterns": [ 4 | "**/bin/**/*", 5 | "**/obj/**/*" 6 | ] 7 | }, 8 | "msbuild": { 9 | "Platform": "rhel.7.2-x64" 10 | } 11 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler.Repositories/DynamoDbOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace KinesisEventHandler.Repositories; 4 | 5 | public class DynamoDbOptions 6 | { 7 | [ConfigurationKeyName("EMPLOYEE_TABLE_NAME")] 8 | public string EmployeeStreamTableName { get; set; } = string.Empty; 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler.Repositories/DynamoDbOptionsValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace KinesisEventHandler.Repositories; 4 | 5 | public class DynamoDbOptionsValidator : IValidateOptions 6 | { 7 | public ValidateOptionsResult Validate(string? name, DynamoDbOptions options) 8 | { 9 | if (name != Options.DefaultName) return ValidateOptionsResult.Skip; 10 | 11 | if (string.IsNullOrEmpty(options.EmployeeStreamTableName)) 12 | { 13 | ValidateOptionsResult.Fail("The EMPLOYEE_TABLE_NAME setting has not been configured"); 14 | } 15 | 16 | return ValidateOptionsResult.Success; 17 | } 18 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler.Repositories/IDynamoDbRepository.cs: -------------------------------------------------------------------------------- 1 | using KinesisEventHandler.Repositories.Mappers; 2 | 3 | namespace KinesisEventHandler.Repositories; 4 | 5 | public interface IDynamoDbRepository where TItem : class 6 | { 7 | Task GetItemAsync(string id, CancellationToken cancellationToken); 8 | 9 | Task PutItemAsync(TItem dto, CancellationToken cancellationToken); 10 | 11 | Task DeleteItemAsync(string id, CancellationToken cancellationToken); 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler.Repositories/Mappers/UpsertResult.cs: -------------------------------------------------------------------------------- 1 | namespace KinesisEventHandler.Repositories.Mappers; 2 | 3 | public enum UpsertResult 4 | { 5 | Inserted, 6 | Updated, 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler.Repositories/Models/EmployeeDto.cs: -------------------------------------------------------------------------------- 1 | namespace KinesisEventHandler.Repositories.Models; 2 | 3 | public record EmployeeDto( 4 | string EmployeeId, 5 | string Email, 6 | string FirstName, 7 | string LastName, 8 | DateTime DateOfBirth, 9 | DateTime DateOfHire 10 | ) 11 | { 12 | public string EmployeeId { get; } = EmployeeId; 13 | public string Email { get; } = Email; 14 | public string FirstName { get; } = FirstName; 15 | public string LastName { get; } = LastName; 16 | public DateTime DateOfBirth { get; } = DateOfBirth; 17 | public DateTime DateOfHire { get; } = DateOfHire; 18 | } -------------------------------------------------------------------------------- /dotnet-test-samples/kinesis-lambda-dynamodb/src/KinesisEventHandler/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "template": "template.yaml" 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/events/event-1.0.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "60 Holbon Viaduct, London, Greater London, EC12 2BN, United Kingdom" 6 | } 7 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/events/event-1.1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "email": "jane.doe@amazon.com", 4 | "firstName": "Jane", 5 | "lastName": "Doe", 6 | "address": "60 Holbon Viaduct, London, Greater London, EC12 2BN, United Kingdom" 7 | } 8 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/events/event-1.2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "address": "60 Holbon Viaduct, London, Greater London, EC12 2BN, United Kingdom" 5 | } 6 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/events/event-1.3.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "60 Holbon Viaduct", 6 | "city": "London", 7 | "state": "Greater London", 8 | "country": "United Kingdom", 9 | "postcode": "EC12 2BN" 10 | } 11 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/events/event-1.4.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "60 Holbon Viaduct, London, Greater London, EC12 2BN, United Kingdom", 6 | "city": "", 7 | "state": "", 8 | "country": "", 9 | "postcode": "" 10 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/img/contract_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/schema-and-contract-testing/img/contract_testing.png -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/img/schema_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/schema-and-contract-testing/img/schema_testing.png -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/src/CreateCustomerFunction/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Amazon.Lambda.Core; 2 | 3 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/src/CreateCustomerFunction/CreateCustomerCommandResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace CreateCustomerFunction; 4 | 5 | using AWS.Lambda.Powertools.Tracing; 6 | 7 | public record CreateCustomerCommandResponse 8 | { 9 | [JsonPropertyName("firstName")] 10 | public string? FirstName { get; init; } 11 | 12 | [JsonPropertyName("lastName")] 13 | public string? LastName { get; init; } 14 | 15 | [JsonPropertyName("address")] 16 | public string? Address { get; init; } 17 | 18 | [JsonPropertyName("success")] 19 | public bool Success { get; init; } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/src/CreateCustomerFunction/CustomerCreatedEvent/CustomerCreatedEventV3.cs: -------------------------------------------------------------------------------- 1 | namespace CreateCustomerFunction.CustomerCreatedEvent; 2 | 3 | using Newtonsoft.Json; 4 | 5 | using SchemaTesting.Shared; 6 | 7 | // Different versions of the same event are used to demonstrate how test failures 8 | // are caused by schema changes 9 | public class CustomerCreatedEventV3 : BaseCustomerCreatedEvent 10 | { 11 | [JsonProperty("customerId")] 12 | public string? CustomerId { get; set; } 13 | 14 | [JsonProperty("address")] 15 | public string? Address { get; set; } 16 | 17 | [JsonProperty("type")] 18 | public override string Type => "CustomerCreatedEventV3"; 19 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/src/SchemaTesting.Shared/IEventPublisher.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace SchemaTesting.Shared; 3 | 4 | public abstract class Event 5 | { 6 | public abstract string Type { get; } 7 | } 8 | 9 | public interface IEventPublisher 10 | { 11 | Task Publish(EventWrapper evt); 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/src/SchemaTesting.Shared/SchemaTesting.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/tests/SchemaTesting.SchemaRegistry/ISchemaReader.cs: -------------------------------------------------------------------------------- 1 | namespace SchemaTesting.SchemaRegistry; 2 | 3 | using Newtonsoft.Json.Schema; 4 | 5 | public interface ISchemaReader 6 | { 7 | Task ReadJsonSchemaAsync(string schemaName, string schemaVersion); 8 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/tests/SchemaTesting.SchemaRegistry/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; 2 | global using FluentAssertions; 3 | global using Moq; -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/tests/SchemaTesting.UnitTest/ISchemaReader.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Schema; 2 | 3 | namespace SchemaTesting.UnitTest; 4 | 5 | public interface ISchemaReader 6 | { 7 | Task ReadJsonSchemaAsync(string schemaVersion); 8 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/tests/SchemaTesting.UnitTest/LocalDiskSchemaReader.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Schema; 2 | 3 | namespace SchemaTesting.UnitTest; 4 | 5 | public class LocalDiskSchemaReader : ISchemaReader 6 | { 7 | public async Task ReadJsonSchemaAsync(string schemaVersion) 8 | { 9 | var schemaData = await File.ReadAllTextAsync($"./schemas/json/customerCreated-v{schemaVersion}.json"); 10 | 11 | var schema = JSchema.Parse(schemaData); 12 | 13 | return schema; 14 | } 15 | } -------------------------------------------------------------------------------- /dotnet-test-samples/schema-and-contract-testing/tests/SchemaTesting.UnitTest/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; 2 | global using FluentAssertions; 3 | global using FakeItEasy; -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/img/send-message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/sqs-lambda/img/send-message.png -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/img/sqs-lambda-sut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/sqs-lambda/img/sqs-lambda-sut.png -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/img/sqs-lambda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/sqs-lambda/img/sqs-lambda.png -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/omnisharp.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileOptions": { 3 | "excludeSearchPatterns": [ 4 | "**/bin/**/*", 5 | "**/obj/**/*" 6 | ] 7 | }, 8 | "msbuild": { 9 | "Platform": "rhel.7.2-x64" 10 | } 11 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SQSEventHandler/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "template": "template.yaml" 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/DynamoDbOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace SqsEventHandler.Repositories; 4 | 5 | public class DynamoDbOptions 6 | { 7 | [ConfigurationKeyName("EMPLOYEE_TABLE_NAME")] 8 | public string EmployeeTableName { get; set; } = string.Empty; 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/DynamoDbOptionsValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace SqsEventHandler.Repositories; 4 | 5 | public class DynamoDbOptionsValidator : IValidateOptions 6 | { 7 | public ValidateOptionsResult Validate(string? name, DynamoDbOptions options) 8 | { 9 | if (name != Options.DefaultName) return ValidateOptionsResult.Skip; 10 | 11 | if (string.IsNullOrEmpty(options.EmployeeTableName)) 12 | { 13 | ValidateOptionsResult.Fail("The EMPLOYEE_TABLE_NAME setting has not been configured"); 14 | } 15 | 16 | return ValidateOptionsResult.Success; 17 | } 18 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/IDynamoDbRepository.cs: -------------------------------------------------------------------------------- 1 | using SqsEventHandler.Repositories.Mappers; 2 | 3 | namespace SqsEventHandler.Repositories; 4 | 5 | public interface IDynamoDbRepository where TItem : class 6 | { 7 | Task GetItemAsync(string id, CancellationToken cancellationToken); 8 | 9 | Task PutItemAsync(TItem dto, CancellationToken cancellationToken); 10 | 11 | Task DeleteItemAsync(string id, CancellationToken cancellationToken); 12 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/Mappers/UpsertResult.cs: -------------------------------------------------------------------------------- 1 | namespace SqsEventHandler.Repositories.Mappers; 2 | 3 | public enum UpsertResult 4 | { 5 | Inserted, 6 | Updated, 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/Models/EmployeeDto.cs: -------------------------------------------------------------------------------- 1 | namespace SqsEventHandler.Repositories.Models; 2 | 3 | public record EmployeeDto( 4 | string EmployeeId, 5 | string Email, 6 | string FirstName, 7 | string LastName, 8 | DateTime DateOfBirth, 9 | DateTime DateOfHire 10 | ) 11 | { 12 | public string EmployeeId { get; } = EmployeeId; 13 | public string Email { get; } = Email; 14 | public string FirstName { get; } = FirstName; 15 | public string LastName { get; } = LastName; 16 | public DateTime DateOfBirth { get; } = DateOfBirth; 17 | public DateTime DateOfHire { get; } = DateOfHire; 18 | } -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/src/SqsEventHandler.Repositories/SqsEventHandler.Repositories.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /dotnet-test-samples/sqs-lambda/tests/SqsEventHandler.IntegrationTests/Utilities/TestPriorityAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace SqsEventHandler.IntegrationTests.Utilities; 2 | 3 | [AttributeUsage(AttributeTargets.Method)] 4 | public class TestPriorityAttribute : Attribute 5 | { 6 | public int Priority { get; private set; } 7 | 8 | public TestPriorityAttribute(int priority) => Priority = priority; 9 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/img/apigw-lambda-ddb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/dotnet-test-samples/test-containers/img/apigw-lambda-ddb.jpg -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/DeleteProduct/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "DeleteProduct::DeleteProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/GetProducts/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "GetProducts::GetProducts.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/PutProduct/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "PutProduct::PutProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/IProductsDAO.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using ServerlessTestApi.Core.Models; 4 | 5 | namespace ServerlessTestApi.Core.DataAccess; 6 | 7 | public interface IProductsDAO 8 | { 9 | Task GetProduct(string id, CancellationToken cancellationToken); 10 | 11 | Task PutProduct(Product product, CancellationToken cancellationToken); 12 | 13 | Task DeleteProduct(string id, CancellationToken cancellationToken); 14 | 15 | Task GetAllProducts(CancellationToken cancellationToken); 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ServerlessTestApi.Core.Models; 5 | 6 | public class Product 7 | { 8 | public Product(string id, string name, decimal price) 9 | { 10 | Id = id; 11 | Name = name; 12 | Price = price; 13 | } 14 | 15 | public string Id { get; set; } 16 | 17 | public string Name { get; set; } 18 | 19 | [JsonPropertyName(nameof(Price))] 20 | public decimal Price { get; private set; } 21 | 22 | public void SetPrice(decimal newPrice) => Price = Math.Round(newPrice, 2); 23 | 24 | public override string ToString() => 25 | $"Product{{id='{Id}', name='{Name}', price={Price}}}"; 26 | 27 | public ProductDTO AsDTO() => new(Id, Name, Price); 28 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/ProductDTO.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestApi.Core.Models; 2 | 3 | public record ProductDTO 4 | { 5 | public ProductDTO() 6 | { 7 | } 8 | 9 | public ProductDTO(string id, string name, decimal price) 10 | { 11 | Id = id; 12 | Name = name; 13 | Price = price; 14 | } 15 | 16 | public string Id { get; init; } 17 | 18 | public string Name { get; init; } 19 | 20 | public decimal Price { get; init; } 21 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/ProductWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ServerlessTestApi.Core.Models; 4 | 5 | public class ProductWrapper 6 | { 7 | public ProductWrapper(List products) => Products = products; 8 | 9 | public List Products { get; } 10 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/ServerlessTestApi.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | ServerlessTestApi.Core 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Core/UpsertOperation.cs: -------------------------------------------------------------------------------- 1 | namespace ServerlessTestApi.Core.DataAccess; 2 | 3 | public enum UpsertResult 4 | { 5 | Inserted, 6 | Updated, 7 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Infrastructure/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using Amazon.Lambda.Core; 2 | 3 | [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer))] -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Infrastructure/DynamoDbOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace ServerlessTestApi.Infrastructure; 4 | 5 | public class DynamoDbOptions 6 | { 7 | [ConfigurationKeyName("PRODUCT_TABLE_NAME")] 8 | public string ProductTableName { get; set; } = string.Empty; 9 | } 10 | -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi.Infrastructure/DynamoDbOptionsValidator.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace ServerlessTestApi.Infrastructure; 4 | 5 | public class DynamoDbOptionsValidator : IValidateOptions 6 | { 7 | public ValidateOptionsResult Validate(string? name, DynamoDbOptions options) 8 | { 9 | if (name == Options.DefaultName) 10 | { 11 | if (string.IsNullOrEmpty(options.ProductTableName)) 12 | { 13 | ValidateOptionsResult.Fail("The PRODUCT_TABLE_NAME setting has not been configured"); 14 | } 15 | 16 | return ValidateOptionsResult.Success; 17 | } 18 | 19 | return ValidateOptionsResult.Skip; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/src/ServerlessTestApi/aws-lambda-tools-defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "Information": [ 3 | "This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.", 4 | "To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.", 5 | "dotnet lambda help", 6 | "All the command line options for the Lambda command can be specified in this file." 7 | ], 8 | "profile": "", 9 | "region": "", 10 | "configuration": "Release", 11 | "function-architecture": "x86_64", 12 | "function-runtime": "dotnet8", 13 | "function-memory-size": 256, 14 | "function-timeout": 30, 15 | "function-handler": "GetProduct::GetProduct.Function::FunctionHandler" 16 | } -------------------------------------------------------------------------------- /dotnet-test-samples/test-containers/tests/ApiTests.IntegrationTestWithEmulation/APITestCollection.cs: -------------------------------------------------------------------------------- 1 | namespace ApiTests.IntegrationTestWithEmulation; 2 | 3 | [CollectionDefinition("APITests")] 4 | public class APITestCollection : ICollectionFixture 5 | { 6 | // This class has no code, and is never created. Its purpose is simply 7 | // to be the place to apply [CollectionDefinition] and all the 8 | // ICollectionFixture<> interfaces. 9 | } -------------------------------------------------------------------------------- /java-test-samples/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = false 9 | max_line_length = 120 10 | tab_width = 4 11 | 12 | [*.java] 13 | indent_size = 2 14 | tab_width = 2 15 | 16 | [{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] 17 | indent_size = 2 18 | tab_width = 2 19 | 20 | [{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}] 21 | indent_size = 2 22 | 23 | [{*.yaml,*.yml}] 24 | indent_size = 2 25 | -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/docs/TicketTopology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/apigw-lambda-ddb/docs/TicketTopology.png -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/load-test-dynamic-data.yml: -------------------------------------------------------------------------------- 1 | config: 2 | phases: 3 | - duration: 60 4 | arrivalRate: 100 5 | processor: "./loadTestData.js" 6 | 7 | scenarios: 8 | - name: "Create Products" 9 | flow: 10 | - post: 11 | url: "/ticket" 12 | beforeRequest: generateRandomTicketData 13 | json: 14 | userId: "{{ userId }}" 15 | description: "{{ description }}" -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/load-test-static-data.yml: -------------------------------------------------------------------------------- 1 | config: 2 | phases: 3 | - duration: 60 4 | arrivalRate: 100 5 | payload: 6 | path: "tickets-static-data.csv" 7 | fields: 8 | - "userId" 9 | - "description" 10 | 11 | scenarios: 12 | - name: "Create Products" 13 | flow: 14 | - post: 15 | url: "/ticket" 16 | json: 17 | userId: "{{ userId }}" 18 | description: "{{ description }}" -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/loadTestData.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var Faker = require('faker'); 3 | 4 | module.exports = { 5 | generateRandomTicketData, 6 | }; 7 | 8 | function generateRandomTicketData(requestParams, ctx, ee, next) { 9 | ctx.vars["userId"] = Faker.name.firstName(); 10 | ctx.vars["description"] = Faker.lorem.sentence(); 11 | 12 | return next(); 13 | } 14 | -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "faker": "^5.5.3" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/run-load-tests-dynamic-data.sh: -------------------------------------------------------------------------------- 1 | STACK_NAME=testing-java-apigw-lambda-ddb 2 | 3 | API_URL=$(aws cloudformation describe-stacks --stack-name $STACK_NAME \ 4 | --query 'Stacks[0].Outputs[?OutputKey==`ApiEndpoint`].OutputValue' \ 5 | --output text) 6 | 7 | echo $API_URL 8 | 9 | artillery run load-test-dynamic-data.yml --target $API_URL -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/run-load-tests-static-data.sh: -------------------------------------------------------------------------------- 1 | STACK_NAME=testing-java-apigw-lambda-ddb 2 | 3 | API_URL=$(aws cloudformation describe-stacks --stack-name $STACK_NAME \ 4 | --query 'Stacks[0].Outputs[?OutputKey==`ApiEndpoint`].OutputValue' \ 5 | --output text) 6 | 7 | echo $API_URL 8 | 9 | artillery run load-test-static-data.yml --target $API_URL -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-ddb/load-test/tickets-static-data.csv: -------------------------------------------------------------------------------- 1 | 101, A 2 | 102, B 3 | 103, C -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-list-s3-buckets/img/xray.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/apigw-lambda-list-s3-buckets/img/xray.JPG -------------------------------------------------------------------------------- /java-test-samples/apigw-lambda-list-s3-buckets/src/test/groovy/com/example/fixtures/BucketFixtures.groovy: -------------------------------------------------------------------------------- 1 | package com.example.fixtures 2 | 3 | import software.amazon.awssdk.services.s3.model.Bucket 4 | import software.amazon.awssdk.services.s3.model.ListBucketsResponse 5 | 6 | class BucketFixtures { 7 | public static final String TEST_BUCKET_NAME = "demo-bucket" 8 | 9 | static listWithBucket(String bucketName = TEST_BUCKET_NAME) { 10 | def bucket = makeBucket(TEST_BUCKET_NAME) 11 | 12 | return ListBucketsResponse.builder() 13 | .buckets(bucket) 14 | .build() 15 | } 16 | 17 | static Bucket makeBucket(String bucketName) { 18 | Bucket.builder() 19 | .name(bucketName) 20 | .build() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java-test-samples/async-lambda-dynamodb/img/lambda-dynamo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/async-lambda-dynamodb/img/lambda-dynamo.png -------------------------------------------------------------------------------- /java-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/aws-lambda-python-e2e-tests/aws-lambda-e2e-tests.yaml: -------------------------------------------------------------------------------- 1 | actions: 2 | - action: "Invoke function aws-lambda-e2eTests" 3 | type: "LAMBDA" 4 | region: "us-east-1" 5 | function_name: "aws-lambda-e2eTests" 6 | handler: "main.handler" 7 | invocation_type: "RequestResponse" 8 | log_type: "Tail" 9 | payload: "{\r\n \"revision\": \"${BUDDY_EXECUTION_REVISION}\"\r\n}" 10 | integration_hash: "<>" 11 | url: "http://<>/" 12 | -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/aws-lambda-python-e2e-tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pip~=23.3.1 2 | wheel~=0.41.2 3 | pytest~=7.4.3 4 | setuptools~=68.2.0 5 | pluggy~=1.3.0 6 | exceptiongroup~=1.1.3 7 | iniconfig~=2.0.0 8 | certifi~=2023.7.22 9 | idna~=3.4 10 | urllib3~=2.1.0 11 | packaging~=23.2 12 | requests~=2.31.0 -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/aws-lambda-python-e2e-tests/tests/config.yaml: -------------------------------------------------------------------------------- 1 | url: http://<>/ 2 | bucket: <> -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/aws-lambda-python-e2e-tests/tests/delete_test.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import yaml 3 | 4 | 5 | def test_delete_user(): 6 | logToUpload = {} 7 | with open("tests/config.yaml", "r") as f: 8 | config = yaml.safe_load(f) 9 | URL = config["url"] 10 | try: 11 | # delete Operation 12 | deleteurl = URL+"customers?customerId=126" 13 | response_delete = requests.delete(deleteurl) 14 | assert response_delete.status_code == 200 15 | print(str(response_delete.text)) 16 | 17 | logToUpload['deleteOperation'] = 'deleteOperation successful' 18 | except: 19 | logToUpload['Lambda failure'] = 'Lambda Failed' 20 | print("Lambda Failed") 21 | 22 | return logToUpload 23 | 24 | if __name__ == "__main__": 25 | test_delete_user() -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/aws-lambda-python-e2e-tests/tests/read_test.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import yaml 3 | 4 | 5 | def test_get_list_of_users(): 6 | logToUpload = {} 7 | with open("tests/config.yaml", "r") as f: 8 | config = yaml.safe_load(f) 9 | URL = config["url"] 10 | try: 11 | # read Operation 12 | readurl = URL+"customers?customerId=124" 13 | response_specific = requests.get(readurl) 14 | assert response_specific.status_code == 200 15 | print(str(response_specific.text)) 16 | logToUpload['readOperation'] = 'readOperation successful' 17 | except: 18 | logToUpload['Lambda failure'] = 'Lambda Failed' 19 | print("Lambda Failed") 20 | 21 | return logToUpload 22 | 23 | if __name__ == "__main__": 24 | test_get_list_of_users() -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/doc/AWS_Lambda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/doc/AWS_Lambda.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/doc/Deloitte_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/doc/Deloitte_logo.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/doc/customer_crud_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/doc/customer_crud_app.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | application.properties 3 | target/ 4 | !.mvn/wrapper/maven-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | 23 | ### NetBeans ### 24 | /nbproject/private/ 25 | /nbbuild/ 26 | /dist/ 27 | /nbdist/ 28 | /.nb-gradle/ 29 | build/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/openjdk11:alpine-jre 2 | # Refer to Maven build -> finalName 3 | ARG JAR_FILE=target/spring-dynamodb-0.0.1-SNAPSHOT.jar 4 | 5 | # cd /opt/app 6 | WORKDIR /opt/app 7 | 8 | # cp target/spring-boot-web.jar /opt/app/app.jar 9 | COPY ${JAR_FILE} app.jar 10 | 11 | EXPOSE 8080 12 | # java -jar /opt/app/app.jar 13 | ENTRYPOINT ["java","-jar","app.jar"] 14 | -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/doc/customer_crud_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/doc/customer_crud_app.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/java/com/amazon/aws/sample/mapper/CustomerMapper.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.mapper; 2 | 3 | import com.amazon.aws.sample.model.Customer; 4 | import com.amazon.aws.sample.model.CustomerView; 5 | import org.springframework.stereotype.Service; 6 | 7 | @Service 8 | public class CustomerMapper { 9 | 10 | /** 11 | * @param customerView 12 | * @return maps the values of customer-view to customer 13 | */ 14 | public Customer convertToCustomer(CustomerView customerView) { 15 | Customer customer = new Customer(); 16 | customer.setCustomerId(customerView.getCustomerId()); 17 | customer.setName(customerView.getName()); 18 | customer.setEmail(customerView.getEmail()); 19 | return customer; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/java/com/amazon/aws/sample/model/CustomerView.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.model; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerView { 7 | private String customerId; 8 | private String name; 9 | private String email; 10 | } 11 | -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | aws.sqs.queue.name=customer-crud-test 3 | aws.sqs.queue.message={"application_status":"ready"} 4 | cloud.aws.region.static = us-east-1 -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/customerDetails.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": { 3 | "S": "1" 4 | }, 5 | "email": { 6 | "S": "customer1@gmail.com" 7 | }, 8 | "name": { 9 | "S": "customer-1" 10 | } 11 | } -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/images/ecs_cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/images/ecs_cluster.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/images/ecs_task_definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/images/ecs_task_definition.png -------------------------------------------------------------------------------- /java-test-samples/fargate-dynamodb-sync/spingboot-with-dynamodb/src/main/resources/sampleRequest.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "customerId": "1", 4 | "name": "customer-1", 5 | "email": "customer1@gmail.com" 6 | }, 7 | { 8 | "customerId": "2", 9 | "name": "customer-2", 10 | "email": "customer2@gmail.com" 11 | }, 12 | { 13 | "customerId": "3", 14 | "name": "customer-3", 15 | "email": "customer3@gmail.com" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:17-alpine 2 | 3 | # Refer to Maven build -> finalName 4 | ARG JAR_FILE=target/async-sqs-lambda-stepfunction-dynamodb-0.0.1-SNAPSHOT.jar 5 | 6 | # cd /opt/app 7 | WORKDIR /opt/app 8 | 9 | # cp target/spring-boot-web.jar /opt/app/app.jar 10 | COPY ${JAR_FILE} app.jar 11 | 12 | EXPOSE 8080 13 | # java -jar /opt/app/app.jar 14 | ENTRYPOINT ["java","-jar","app.jar"] 15 | 16 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/ECS_cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/ECS_cluster.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/ECS_task_definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/ECS_task_definition.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/async-order-processing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/doc/async-order-processing.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/main/java/com/amazon/aws/sample/entity/OrderResponse.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.entity; 2 | 3 | import lombok.Getter; 4 | import lombok.NoArgsConstructor; 5 | import lombok.Setter; 6 | 7 | @Getter 8 | @Setter 9 | @NoArgsConstructor 10 | public class OrderResponse { 11 | private String message; 12 | private String uuid; 13 | } 14 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/main/java/com/amazon/aws/sample/exception/OrderException.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.exception; 2 | 3 | public class OrderException extends RuntimeException { 4 | public OrderException(String str) { 5 | /** calling the constructor of parent Exception **/ 6 | super(str); 7 | } 8 | } -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/main/java/com/amazon/aws/sample/utils/AmazonDynamoDBClientBuilderService.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.utils; 2 | 3 | import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public interface AmazonDynamoDBClientBuilderService { 8 | AmazonDynamoDB buildClient(); 9 | } 10 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/main/java/com/amazon/aws/sample/utils/Uuid.java: -------------------------------------------------------------------------------- 1 | package com.amazon.aws.sample.utils; 2 | 3 | import java.util.UUID; 4 | 5 | public class Uuid { 6 | public static String generateUuid() { 7 | return UUID.randomUUID().toString(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | cloud.aws.region.auto=false 3 | cloud.aws.region.end-point.uri=<> 4 | cloud.aws.region.static=us-east-1 5 | -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/test/resources/order_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "orderId": { 3 | "S": "abee61d5-e180-4d01-bdb5-f7ce31562a81" 4 | }, 5 | "company": { 6 | "S": "Samsung" 7 | }, 8 | "customerId": { 9 | "S": "C420" 10 | }, 11 | "deliveryAddressCode": { 12 | "S": "129384" 13 | }, 14 | "model": { 15 | "S": "A23" 16 | }, 17 | "orderStatus": { 18 | "S": "Order Placed" 19 | }, 20 | "productId": { 21 | "S": "P101" 22 | }, 23 | "productName": { 24 | "S": "Android" 25 | }, 26 | "quantity": { 27 | "S": "1" 28 | }, 29 | "sellerId": { 30 | "S": "S101" 31 | } 32 | } -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/async-sqs-lambda-stepfunction-dynamodb/src/test/resources/product_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "productId": { 3 | "S": "P102" 4 | }, 5 | "company": { 6 | "S": "Samsung" 7 | }, 8 | "model": { 9 | "S": "A33" 10 | }, 11 | "productName": { 12 | "S": "Android" 13 | }, 14 | "productStock": { 15 | "N": "5" 16 | }, 17 | "sellerId": { 18 | "S": "S102" 19 | } 20 | } -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/doc/Deloitte_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/doc/Deloitte_logo.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/doc/Serverless-async-Test-Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/doc/Serverless-async-Test-Architecture.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/doc/async-order-processing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/doc/async-order-processing.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/integration-test/MyCustomException.py: -------------------------------------------------------------------------------- 1 | class MyCustomException(Exception): 2 | def __init__(self, message="Default error message"): 3 | self.message = message 4 | super().__init__(self.message) -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/Lambda-function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/Lambda-function.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/Step-function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/Step-function.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/async-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/doc/async-arch.png -------------------------------------------------------------------------------- /java-test-samples/fargate-lambda-stepfunction-async/lambda-stepfunction-invoke/src/main/resources/config.properties: -------------------------------------------------------------------------------- 1 | cloud.aws.statemachine.arn=arn:aws:states:us-east-1:<>:stateMachine:pocserverless-automation -------------------------------------------------------------------------------- /java-test-samples/img/authors/Aruna_Shanubhogue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Aruna_Shanubhogue.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/Evani_Kranthi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Evani_Kranthi.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/Harsha_Vardhan_Allena.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Harsha_Vardhan_Allena.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/Indrajit_Bose.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Indrajit_Bose.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/Ravindra_Palisetti.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Ravindra_Palisetti.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/Venkatesh_Peddada.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/Venkatesh_Peddada.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/aneel-murari.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/aneel-murari.jpeg -------------------------------------------------------------------------------- /java-test-samples/img/authors/dhiraj-mahapatro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/dhiraj-mahapatro.jpg -------------------------------------------------------------------------------- /java-test-samples/img/authors/gustavo-martim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/gustavo-martim.png -------------------------------------------------------------------------------- /java-test-samples/img/authors/khairul-habib.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/khairul-habib.jpeg -------------------------------------------------------------------------------- /java-test-samples/img/authors/matt-ridehalgh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/matt-ridehalgh.png -------------------------------------------------------------------------------- /java-test-samples/img/authors/rahul-popat.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/authors/rahul-popat.jpeg -------------------------------------------------------------------------------- /java-test-samples/img/generic-async-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/generic-async-test.png -------------------------------------------------------------------------------- /java-test-samples/img/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/generic.png -------------------------------------------------------------------------------- /java-test-samples/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/appspec.yml: -------------------------------------------------------------------------------- 1 | version: 0.0 2 | os: linux 3 | files: 4 | - source: ./java-appsync-sam/target/*.jar 5 | destination: /tmp -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/Architecture-appsync.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/Architecture-appsync.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/CodePipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/CodePipeline.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/TestingDashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/TestingDashboard.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/cloudformation-stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/cloudformation-stack.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/cloudformation-testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/cloudformation-testing.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/schema.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/assets/sut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/java-appsync-sam/assets/sut.png -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/main/java/com/example/App.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | import org.slf4j.Logger; 3 | import org.slf4j.LoggerFactory; 4 | 5 | public class App { 6 | private static final Logger logger = LoggerFactory.getLogger(App.class); 7 | 8 | public static void main(String... args) { 9 | logger.info("Application starts"); 10 | 11 | Handler handler = new Handler(); 12 | handler.sendRequest(); 13 | 14 | logger.info("Application ends"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/main/java/com/example/DependencyFactory.java: -------------------------------------------------------------------------------- 1 | 2 | package com.example; 3 | 4 | import software.amazon.awssdk.http.apache.ApacheHttpClient; 5 | import software.amazon.awssdk.services.appsync.AppSyncClient; 6 | 7 | /** 8 | * The module containing all dependencies required by the {@link Handler}. 9 | */ 10 | public class DependencyFactory { 11 | 12 | private DependencyFactory() {} 13 | 14 | /** 15 | * @return an instance of AppSyncClient 16 | */ 17 | public static AppSyncClient appSyncClient() { 18 | return AppSyncClient.builder() 19 | .httpClientBuilder(ApacheHttpClient.builder()) 20 | .build(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/main/java/com/example/Handler.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import software.amazon.awssdk.services.appsync.AppSyncClient; 4 | 5 | 6 | public class Handler { 7 | private final AppSyncClient appSyncClient; 8 | 9 | public Handler() { 10 | appSyncClient = DependencyFactory.appSyncClient(); 11 | } 12 | 13 | public void sendRequest() { 14 | // TODO: invoking the api calls using appSyncClient. 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_booking_request.vtl: -------------------------------------------------------------------------------- 1 | #set($bookingid = $util.defaultIfNullOrBlank($ctx.args.bookingid, $util.autoId())) 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "PutItem", 5 | "key": { 6 | "bookingid": $util.dynamodb.toDynamoDBJson($bookingid) 7 | }, 8 | "attributeValues" : { 9 | "resourceid": $util.dynamodb.toDynamoDBJson($ctx.args.resourceid), 10 | "userid": $util.dynamodb.toDynamoDBJson(${context.identity.sub}), 11 | "starttimeepochtime": $util.dynamodb.toDynamoDBJson($ctx.args.starttimeepochtime), 12 | "timestamp": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_booking_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_location_request.vtl: -------------------------------------------------------------------------------- 1 | #set($locationid = $util.defaultIfNullOrBlank($ctx.args.locationid, $util.autoId())) 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "PutItem", 5 | "key": { 6 | "locationid": $util.dynamodb.toDynamoDBJson($locationid) 7 | }, 8 | "attributeValues" : { 9 | "name": $util.dynamodb.toDynamoDBJson($ctx.args.name), 10 | "description": $util.dynamodb.toDynamoDBJson($ctx.args.description), 11 | "imageUrl": $util.dynamodb.toDynamoDBJson($ctx.args.imageUrl), 12 | "timestamp": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()) 13 | } 14 | } -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_location_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_resource_request.vtl: -------------------------------------------------------------------------------- 1 | #set($resourceid = $util.defaultIfNullOrBlank($ctx.args.resourceid, $util.autoId())) 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "PutItem", 5 | "key": { 6 | "resourceid": $util.dynamodb.toDynamoDBJson($resourceid) 7 | }, 8 | "attributeValues" : { 9 | "locationid": $util.dynamodb.toDynamoDBJson($ctx.args.locationid), 10 | "name": $util.dynamodb.toDynamoDBJson($ctx.args.name), 11 | "description": $util.dynamodb.toDynamoDBJson($ctx.args.description), 12 | "type": $util.dynamodb.toDynamoDBJson($ctx.args.type), 13 | "timestamp": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/create_resource_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/delete_booking_response.vtl: -------------------------------------------------------------------------------- 1 | #if ( $ctx.error ) 2 | #if ( $ctx.error.type.equals("DynamoDB:ConditionalCheckFailedException") ) 3 | $util.error("User is not authorized to perform this action.", "Unauthorized") 4 | #else 5 | $util.error($ctx.error.message, $ctx.error.type) 6 | #end 7 | #else 8 | $utils.toJson($ctx.args.bookingid) 9 | #end 10 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/delete_location_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "DeleteItem", 4 | "key": { 5 | "locationid": $util.dynamodb.toDynamoDBJson($ctx.args.locationid) 6 | } 7 | } -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/delete_location_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($ctx.args.locationid) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/delete_resource_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "DeleteItem", 4 | "key": { 5 | "resourceid": $util.dynamodb.toDynamoDBJson($ctx.args.resourceid) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/delete_resource_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($ctx.args.resourceid) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_booking_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "GetItem", 4 | "key": { 5 | "bookingid": $util.dynamodb.toDynamoDBJson($ctx.args.bookingid) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_booking_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_bookings_for_resource_request.vtl: -------------------------------------------------------------------------------- 1 | #set($resourceid = $util.defaultIfNullOrBlank($ctx.args.resourceid, $ctx.source.resourceid)) 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "Query", 5 | "query" : { 6 | "expression": "resourceid = :resourceid", 7 | "expressionValues" : { 8 | ":resourceid" : $util.dynamodb.toDynamoDBJson($resourceid) 9 | } 10 | }, 11 | "index": "bookingsByResourceByTimeGSI" 12 | } 13 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_bookings_for_resource_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result.items) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_bookings_for_user_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "Query", 4 | "query" : { 5 | "expression": "userid = :userid", 6 | "expressionValues" : { 7 | ":userid" : $util.dynamodb.toDynamoDBJson(${context.identity.sub}) 8 | } 9 | }, 10 | "index": "useridGSI" 11 | } 12 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_bookings_for_user_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result.items) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_location_request.vtl: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "GetItem", 5 | "key": { 6 | "locationid": $util.dynamodb.toDynamoDBJson($ctx.args.locationid) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_location_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_locations_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "Scan" 4 | } 5 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_locations_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result.items) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_resource_request.vtl: -------------------------------------------------------------------------------- 1 | { 2 | "version" : "2018-05-29", 3 | "operation" : "GetItem", 4 | "key": { 5 | "resourceid": $util.dynamodb.toDynamoDBJson($ctx.args.resourceid) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_resource_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result) -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_resources_for_location_request.vtl: -------------------------------------------------------------------------------- 1 | #set($locationid = $util.defaultIfNullOrBlank($ctx.args.locationid, $ctx.source.locationid)) 2 | { 3 | "version" : "2018-05-29", 4 | "operation" : "Query", 5 | "query" : { 6 | "expression": "locationid = :locationid", 7 | "expressionValues" : { 8 | ":locationid" : $util.dynamodb.toDynamoDBJson($locationid) 9 | } 10 | }, 11 | "index": "locationidGSI" 12 | } 13 | -------------------------------------------------------------------------------- /java-test-samples/java-appsync-sam/src/mapping_templates/get_resources_for_location_response.vtl: -------------------------------------------------------------------------------- 1 | $utils.toJson($context.result.items) -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 4 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = false 12 | insert_final_newline = false -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/img/contract_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/schema-and-contract-testing/img/contract_testing.png -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/img/schema_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/schema-and-contract-testing/img/schema_testing.png -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/main/java/com/example/App.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/main/java/com/example/CustomerValidator.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.fasterxml.jackson.databind.JsonNode; 4 | 5 | /* 6 | * Example of customer validator class 7 | */ 8 | public class CustomerValidator { 9 | 10 | // Example of address validation, implemented on business logic side 11 | public boolean isValidAddress(JsonNode jsonPayload){ 12 | String address = jsonPayload.get("address").asText(); 13 | return address.split(",").length == 4; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/test/resources/events/customerCreated-event-1.0.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia" 6 | } 7 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/test/resources/events/customerCreated-event-1.1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "email": "jane@example.com", 6 | "address": "2 Park St, Sydney, NSW 2000, Australia" 7 | } 8 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/test/resources/events/customerCreated-event-1.2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "firstName": "Jane", 5 | "lastName": "Doe", 6 | "email": "jane@example.com", 7 | "address": "2 Park St, Sydney, NSW 2000, Australia" 8 | } 9 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/test/resources/events/customerCreated-event-1.3.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "email": "jane@example.com", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia" 6 | } 7 | -------------------------------------------------------------------------------- /java-test-samples/schema-and-contract-testing/src/test/resources/events/customerCreated-event-1.4.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St", 6 | "city": "Sydney", 7 | "state": "NSW", 8 | "country": "Australia", 9 | "postcode": "2000" 10 | } -------------------------------------------------------------------------------- /java-test-samples/step-functions-local/images/stepfunctions_local_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/java-test-samples/step-functions-local/images/stepfunctions_local_test.png -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/img/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/img/diagram.png -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/img/sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/img/sequence.png -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/src/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/tests/data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/tests/data -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/tests/integration/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-mock 3 | boto3 4 | moto 5 | aws_lambda_powertools 6 | aws-xray-sdk 7 | fastjsonschema 8 | pyyaml 9 | uuid -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-dynamodb/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-dynamodb/tests/unit/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/img/pattern_05_lambda_layer_sut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/img/pattern_05_lambda_layer_sut.png -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/img/pattern_05_lambda_layer_test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/img/pattern_05_lambda_layer_test.jpg -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/src/sampleCodeLayer/python/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/src/sampleCodeLayer/python/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/src/sampleCodeLayer/python/layer.py: -------------------------------------------------------------------------------- 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # SPDX-License-Identifier: MIT-0 3 | 4 | import boto3 5 | 6 | def get_s3_bucket_list_as_string() -> str: 7 | 8 | print("Hello layer!") 9 | 10 | s3_client = boto3.client('s3') 11 | s3_response = s3_client.list_buckets() 12 | 13 | bucket_list_string = "|".join([x["Name"] for x in s3_response["Buckets"]]) 14 | 15 | return bucket_list_string -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/src/sampleLambda/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/src/sampleLambda/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/src/sampleLambda/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/src/sampleSchemaLayer/python/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/src/sampleSchemaLayer/python/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-mock 3 | boto3 4 | moto 5 | aws_lambda_powertools 6 | aws-xray-sdk 7 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda-layer/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda-layer/tests/unit/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/img/xray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda/img/xray.png -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/src/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda/tests/integration/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-mock 3 | boto3 4 | moto 5 | aws_lambda_powertools 6 | aws-xray-sdk 7 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/apigw-lambda/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-lambda/tests/unit/__init__.py -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/img/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-sqs-lambda-sqs/img/architecture.png -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | log_cli = true 3 | -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/src/process-input-queue/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-sqs-lambda-sqs/src/process-input-queue/requirements.txt -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/src/write-test-result/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/apigw-sqs-lambda-sqs/src/write-test-result/requirements.txt -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | boto3 3 | moto 4 | uuid 5 | requests 6 | -------------------------------------------------------------------------------- /python-test-samples/apigw-sqs-lambda-sqs/tests/unit/pass_test.py: -------------------------------------------------------------------------------- 1 | # test_pass.py 2 | def test_do_nothing(): 3 | pass 4 | -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/async-lambda-dynamodb/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/src/requirements.txt: -------------------------------------------------------------------------------- 1 | # Those dependencies can be omitted: 2 | # - boto3 is part of Lambda runtime for Python 3 | # - aws-lambda-powertools is embedded as a layer (see SAM template) 4 | # This is always a good practice as your lambda packaged code will be much lighter, and it will be invoked quicker 5 | 6 | boto3 7 | aws-lambda-powertools 8 | -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/async-lambda-dynamodb/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/async-lambda-dynamodb/tests/integration/__init__.py -------------------------------------------------------------------------------- /python-test-samples/async-lambda-dynamodb/tests/integration/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-mock 3 | boto3 4 | moto 5 | aws_lambda_powertools 6 | aws-xray-sdk 7 | fastjsonschema 8 | backoff -------------------------------------------------------------------------------- /python-test-samples/img/authors/arthi-jaganathan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/arthi-jaganathan.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/brian-krygsman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/brian-krygsman.png -------------------------------------------------------------------------------- /python-test-samples/img/authors/dan-fox.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/dan-fox.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/dan-straw.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/dan-straw.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/guy-almog.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/guy-almog.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/katherine-vishnevskaya.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/katherine-vishnevskaya.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/ramesh-mathikumar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/ramesh-mathikumar.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/tom-romano.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/tom-romano.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/authors/yossi-chai.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/authors/yossi-chai.jpeg -------------------------------------------------------------------------------- /python-test-samples/img/generic-async-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/generic-async-test.png -------------------------------------------------------------------------------- /python-test-samples/img/generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/generic.png -------------------------------------------------------------------------------- /python-test-samples/img/lambda-dynamo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/lambda-dynamo.png -------------------------------------------------------------------------------- /python-test-samples/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/img/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/img/architecture.png -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/img/plugin_tester_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/img/plugin_tester_1.png -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/1-prevalidate-plugins/test-prevalidate-plugin/functions/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/1-prevalidate-plugins/test-prevalidate-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test_plugin", 3 | "version": "1.0.0", 4 | "description": "This plugin demonstrates testing best practices for sample video plugin system", 5 | "main": "app.js", 6 | "author": "Dan Fox, AWS", 7 | "license": "MIT", 8 | "dependencies": { 9 | "@aws-sdk/client-eventbridge": "^3.406.0", 10 | "axios": ">=0.21.1" 11 | }, 12 | "scripts": { 13 | "test": "mocha tests/" 14 | }, 15 | "devDependencies": { 16 | "@aws-sdk/client-cloudformation": "^3.405.0", 17 | "@aws-sdk/client-sfn": "^3.405.0", 18 | "chai": "^4.3.6", 19 | "mocha": "^10.1.0", 20 | "uuid": "^9.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/1-prevalidate-plugins/test-prevalidate-plugin/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TestPlugin", 3 | "description": "A plugin that demonstrates testing best practices", 4 | "author": "Dan Fox", 5 | "version": "1.0.0", 6 | "tags": ["testing", "AWS", "serverless"], 7 | "eventHook": "preValidate", 8 | "average_completion_time": "10s", 9 | "services":["StepFunctions","AWS Lambda"], 10 | "deployment_template":"template.yaml", 11 | "output_example":{ 12 | "valid":"BOOL" 13 | } 14 | } -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/__init__.py -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/functions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/functions/__init__.py -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/functions/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3 -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/tests/integration/__init__.py -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/2-postvalidate-plugins/python-minimal-plugin/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3 2 | botocore 3 | requests 4 | aws-iatk -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/3-premetadata-plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/3-premetadata-plugins/.gitkeep -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/4-postmetadata-plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/integrated-application-test-kit/plugins/4-postmetadata-plugins/.gitkeep -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/plugin_tester/code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "localTest.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "James Beswick", 14 | "license": "MIT-0", 15 | "devDependencies": { 16 | "aws-sdk": "^2.962.0" 17 | }, 18 | "dependencies": { 19 | "@aws-sdk/client-sfn": "^3.370.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /python-test-samples/integrated-application-test-kit/plugins/plugin_tester/samconfig.toml: -------------------------------------------------------------------------------- 1 | version = 0.1 2 | [default.deploy.parameters] 3 | stack_name = "video-plugin-tester" 4 | resolve_s3 = true 5 | s3_prefix = "video-plugin-tester" 6 | capabilities = "CAPABILITY_IAM" 7 | image_repositories = [] 8 | region="us-west-2" -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/img/integration-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/img/integration-test-description.png -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/img/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/img/system-under-test-description.png -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/img/system-under-test.png -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/img/unit-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/img/unit-test-description.png -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/src/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/tests/data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/tests/data -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/tests/integration/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/tests/integration/__init__.py -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | pytest-mock 3 | boto3 4 | moto 5 | aws_lambda_powertools 6 | aws-xray-sdk 7 | fastjsonschema 8 | pyyaml 9 | uuid -------------------------------------------------------------------------------- /python-test-samples/kinesis-lambda-dynamodb/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/kinesis-lambda-dynamodb/tests/unit/__init__.py -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/doc/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/doc/architecture.png -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/doc/pattern_04_lambda_mock_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/doc/pattern_04_lambda_mock_test.png -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/src/sample_lambda/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/src/sample_lambda/__init__.py -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/src/sample_lambda/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-lambda-powertools 2 | pydantic 3 | fastjsonschema -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | moto>=3.0.7 2 | pytest 3 | pytest-socket 4 | coverage 5 | validators 6 | boto3 7 | aws_lambda_powertools 8 | fastjsonschema 9 | pylint 10 | bandit -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/tests/unit/__init__.py -------------------------------------------------------------------------------- /python-test-samples/lambda-mock/tests/unit/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/lambda-mock/tests/unit/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | .venv/ 3 | .vscode/ 4 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/events/customerCreated-event-1.0.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia" 6 | } 7 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/events/customerCreated-event-1.1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "email": "jane@example.com", 6 | "address": "2 Park St, Sydney, NSW 2000, Australia" 7 | } 8 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/events/customerCreated-event-1.2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "firstName": "Jane", 5 | "lastName": "Doe", 6 | "email": "jane@example.com", 7 | "address": "2 Park St, Sydney, NSW 2000, Australia" 8 | } 9 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/events/customerCreated-event-1.3.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "email": "jane@example.com", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia" 6 | } 7 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/events/customerCreated-event-1.4.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St", 6 | "city": "Sydney", 7 | "state": "NSW", 8 | "country": "Australia", 9 | "postcode": "2000" 10 | } -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/img/contract_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/schema-and-contract-testing/img/contract_testing.png -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/img/schema_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/schema-and-contract-testing/img/schema_testing.png -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/requirements.txt: -------------------------------------------------------------------------------- 1 | iniconfig==2.0.0 2 | packaging==23.1 3 | pluggy==1.0.0 4 | pydantic==1.10.13 5 | pytest==7.3.1 6 | typing_extensions==4.5.0 7 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/schema-and-contract-testing/src/__init__.py -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/src/customer_v1_0_0.py: -------------------------------------------------------------------------------- 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # SPDX-License-Identifier: MIT-0 3 | 4 | from __future__ import annotations 5 | 6 | from pydantic import BaseModel, Field 7 | 8 | 9 | class Customer(BaseModel): 10 | """Class representing a customer""" 11 | customerId: str = Field( 12 | ..., examples=['577af109-1f19-4d0a-9c56-359f44ca0034'], title='Customerid' 13 | ) 14 | firstName: str = Field(..., examples=['Jane'], title='Firstname') 15 | lastName: str = Field(..., examples=['Doe'], title='Lastname') 16 | address: str = Field( 17 | ..., examples=['2 Park St, Sydney, NSW 2000, Australia'], title='Address' 18 | ) 19 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/src/customer_v1_3_0.py: -------------------------------------------------------------------------------- 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # SPDX-License-Identifier: MIT-0 3 | 4 | from __future__ import annotations 5 | 6 | from typing import Optional 7 | 8 | from pydantic import BaseModel, Field 9 | 10 | 11 | class Customer(BaseModel): 12 | """Class representing a customer""" 13 | customerId: str = Field( 14 | ..., examples=['577af109-1f19-4d0a-9c56-359f44ca0034'], title='Customerid' 15 | ) 16 | name: str = Field(..., examples=['Jane Doe'], title='Name') 17 | email: Optional[str] = Field('', examples=['Jane.Doe@example.com'], title='Email') 18 | address: str = Field( 19 | ..., examples=['2 Park St, Sydney, NSW 2000, Australia'], title='Address' 20 | ) 21 | -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/schema-and-contract-testing/tests/__init__.py -------------------------------------------------------------------------------- /python-test-samples/schema-and-contract-testing/tests/context.py: -------------------------------------------------------------------------------- 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | # SPDX-License-Identifier: MIT-0 3 | 4 | import os 5 | import sys 6 | 7 | # allow importing models from src folder one level up. 8 | 9 | sys.path.insert( 10 | 0, 11 | os.path.abspath( 12 | os.path.join( 13 | os.path.dirname(__file__), 14 | '../src'))) 15 | 16 | from customer_v1_0_0_with_validation import Customer as ConsumerCustomerModel 17 | from customer_v1_0_0 import Customer as CustomerModel 18 | -------------------------------------------------------------------------------- /python-test-samples/step-functions-local/img/stepfunctions_local_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/step-functions-local/img/stepfunctions_local_test.png -------------------------------------------------------------------------------- /python-test-samples/step-functions-local/img/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/python-test-samples/step-functions-local/img/system-under-test-description.png -------------------------------------------------------------------------------- /python-test-samples/step-functions-local/statemachine/test/valid_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "firstname": "Jane", 4 | "lastname": "Doe", 5 | "identity": { 6 | "email": "jdoe@example.com", 7 | "ssn": "123-45-6789" 8 | }, 9 | "address": { 10 | "street": "123 Main St", 11 | "city": "Columbus", 12 | "state": "OH", 13 | "zip": "43219" 14 | }, 15 | "comments": "I am glad to sign-up for this service. Looking forward to different options." 16 | } 17 | } -------------------------------------------------------------------------------- /python-test-samples/step-functions-local/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3>=1.26.79 2 | pytest>=7.2.1 3 | pathlib 4 | testcontainers -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/env.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters": { 3 | "DYNAMODB_TABLE_NAME": "sam-apigw-lambda-ddb-DynamoDBTable-1XEMBHFVCFMGF" 4 | } 5 | } -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/img/sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-dynamodb/img/sequence.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/img/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-dynamodb/img/system-under-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-dynamodb/img/system-under-test.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ["/jest.integration.config.ts","/jest.unit.config.ts"], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | verbose: true, 16 | testMatch: ['**/tests/**/*.test.ts'] 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: "integration", 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/jest.unit.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: "unit", 3 | testMatch: ['**/tests/unit/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-dynamodb/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": false, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module":"es2015", 9 | "moduleResolution":"node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true, 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/env.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters": { 3 | "WEATHER_API": "https://goweather.herokuapp.com/weather/" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/img/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-external/img/system-under-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-external/img/system-under-test.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: "@typescript-eslint/parser", 3 | parserOptions: { 4 | ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features 5 | sourceType: "module", 6 | }, 7 | extends: [ 8 | "plugin:@typescript-eslint/recommended", // recommended rules from the @typescript-eslint/eslint-plugin 9 | "plugin:prettier/recommended", // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. 10 | ], 11 | rules: { 12 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 13 | // e.g. "@typescript-eslint/explicit-function-return-type": "off", 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ['/jest.integration.config.ts', '/jest.unit.config.ts'], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | verbose: true, 16 | testMatch: ['**/tests/**/*.test.ts'], 17 | }; 18 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'integration', 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/jest.unit.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'unit', 3 | testMatch: ['**/tests/unit/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-external/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": false, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/architecture.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/capture_payload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/capture_payload.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/cold_start_traces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/cold_start_traces.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/flamegraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/flamegraph.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/monitor.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/monitor_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/monitor_service.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/new_monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/new_monitor.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/new_synthetic_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/new_synthetic_test.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/sns_sqs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/sns_sqs.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/successful_synthetic_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/successful_synthetic_test.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetic_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetic_test.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetics_assertion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetics_assertion.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetics_test_menu_item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/apigw-lambda-sqs-sns-datadog/images/synthetics_test_menu_item.png -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | roots: ['/test'], 4 | testMatch: ['**/*.test.ts'], 5 | transform: { 6 | '^.+\\.tsx?$': 'ts-jest' 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/resources/delay.ts: -------------------------------------------------------------------------------- 1 | export default async function delay(ms: number): Promise { 2 | return new Promise((res) => { setTimeout(res, ms) }) 3 | } 4 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/resources/worker.ts: -------------------------------------------------------------------------------- 1 | import { SQSEvent } from "aws-lambda"; 2 | import axios from 'axios'; 3 | import delay from './delay'; 4 | 5 | exports.main = async function(event: SQSEvent): Promise { 6 | for (let i=0; i < 5; i++) { 7 | await axios.get('https://datadoghq.com'); 8 | await delay(15); 9 | } 10 | console.log('SQS worker successfully received event:', event) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /typescript-test-samples/apigw-lambda-sqs-sns-datadog/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2020" 7 | ], 8 | "strict": true, 9 | "noImplicitAny": true, 10 | "strictNullChecks": true, 11 | "noImplicitThis": true, 12 | "alwaysStrict": true, 13 | "noUnusedLocals": false, 14 | "noUnusedParameters": false, 15 | "noImplicitReturns": true, 16 | "noFallthroughCasesInSwitch": false, 17 | "inlineSourceMap": true, 18 | "inlineSources": true, 19 | "experimentalDecorators": true, 20 | "strictPropertyInitialization": false, 21 | "typeRoots": [ 22 | "./node_modules/@types" 23 | ] 24 | }, 25 | "exclude": [ 26 | "node_modules", 27 | "cdk.out" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/env.template: -------------------------------------------------------------------------------- 1 | COGNITO_USER_POOL_ID={YOUR_COGNITO_USER_POOL_ID} 2 | COGNITO_CLIENT_ID={YOUR_COGNITO_CLIENT_ID} 3 | APPSYNC_URL={YOUR_APPSYNC_URL} 4 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/functions/get-random-message/handler.ts: -------------------------------------------------------------------------------- 1 | import Chance from 'chance'; 2 | 3 | const chance = new Chance.Chance(); 4 | 5 | interface Response { 6 | message: string; 7 | } 8 | 9 | export const main = async (): Promise => { 10 | return Promise.resolve({ 11 | message: `Meet ${chance.name()}, a ${chance.animal()} who lives in ${chance.city()}!`, 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/appsync-cognito-lambda-aleios/images/architecture.png -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ['/jest.integration.config.ts'], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | verbose: true, 16 | testMatch: ['**/tests/**/*.test.ts'], 17 | }; 18 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: "integration", 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/lib/schema.graphql: -------------------------------------------------------------------------------- 1 | type randomMessageResponse { 2 | message: String! 3 | } 4 | 5 | type Query { 6 | getRandomMessage: randomMessageResponse! 7 | } 8 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/tests/helpers/cognito/index.ts: -------------------------------------------------------------------------------- 1 | export * from './delete-user'; 2 | export * from './get-token'; 3 | export * from './sign-up'; 4 | -------------------------------------------------------------------------------- /typescript-test-samples/appsync-cognito-lambda-aleios/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "lib": ["es2020"], 5 | "strict": true, 6 | "noEmitOnError": true, 7 | "sourceMap": true, 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/.gitignore: -------------------------------------------------------------------------------- 1 | **/node_modules/ 2 | **/coverage/ -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/async-lambda-dynamodb/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ['/jest.integration.config.ts', '/jest.unit.config.ts'], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | testMatch: ['**/tests/**/*.test.ts'], 16 | }; 17 | -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'integration', 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/jest.unit.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'unit', 3 | testMatch: ['**/tests/unit/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/async-lambda-dynamodb/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": true, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module":"es2015", 9 | "moduleResolution":"node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "typeRoots": [ 14 | "./node_modules/@types" 15 | ] 16 | }, 17 | "exclude": ["node_modules", "**/*.test.ts"] 18 | } -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/aaron-stuyvenberg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/aaron-stuyvenberg.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/aiden-walton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/aiden-walton.png -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/arthi-jaganathan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/arthi-jaganathan.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/brian-krygsman.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/brian-krygsman.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/brian-rinaldi.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/brian-rinaldi.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/chanki-nathani.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/chanki-nathani.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/debasis-mitra.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/debasis-mitra.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/jordi-macia.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/jordi-macia.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/katherine-vishnevskaya.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/katherine-vishnevskaya.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/mark-white.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/mark-white.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/authors/richard-vidis.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/authors/richard-vidis.jpeg -------------------------------------------------------------------------------- /typescript-test-samples/img/generic-async-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/generic-async-system.png -------------------------------------------------------------------------------- /typescript-test-samples/img/generic-async-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/generic-async-test.png -------------------------------------------------------------------------------- /typescript-test-samples/img/lambda-dynamo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/lambda-dynamo.png -------------------------------------------------------------------------------- /typescript-test-samples/img/s3-lambda-s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/img/s3-lambda-s3.png -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/img/integration-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/kinesis-lambda-dynamodb/img/integration-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/img/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/kinesis-lambda-dynamodb/img/system-under-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/kinesis-lambda-dynamodb/img/system-under-test.png -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/img/unit-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/kinesis-lambda-dynamodb/img/unit-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: "@typescript-eslint/parser", 3 | parserOptions: { 4 | ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features 5 | sourceType: "module" 6 | }, 7 | extends: [ 8 | "plugin:@typescript-eslint/recommended", // recommended rules from the @typescript-eslint/eslint-plugin 9 | "plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. 10 | ], 11 | rules: { 12 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 13 | // e.g. "@typescript-eslint/explicit-function-return-type": "off", 14 | } 15 | }; 16 | Footer 17 | -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ["/jest.integration.config.ts","/jest.unit.config.ts"], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | verbose: true, 16 | testMatch: ['**/tests/**/*.test.ts'] 17 | }; -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: "integration", 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/jest.unit.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: "unit", 3 | testMatch: ['**/tests/unit/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/tests/integration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "record_processor_integration_tests", 3 | "version": "1.0.0", 4 | "description": "Kinesis records processor sample", 5 | "main": "src/appTest.js", 6 | "license": "MIT", 7 | "dependencies": { 8 | "@aws-sdk/client-dynamodb": "^3.44.0", 9 | "@aws-sdk/client-kinesis": "^3.306.0", 10 | "@aws-sdk/lib-dynamodb": "^3.44.0", 11 | "@aws-sdk/util-dynamodb": "^3.306.0", 12 | "aws-lambda": "^1.0.7", 13 | "esbuild": "^0.14.14" 14 | }, 15 | "devDependencies": { 16 | "@types/aws-lambda": "^8.10.92", 17 | "@types/node": "^17.0.13", 18 | "ts-node": "^10.4.0", 19 | "typescript": "^4.5.5", 20 | "uuid": "^9.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /typescript-test-samples/kinesis-lambda-dynamodb/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "compilerOptions": { 4 | "target": "es2020", 5 | "strict": false, 6 | "preserveConstEnums": true, 7 | "noEmit": true, 8 | "sourceMap": false, 9 | "module":"es2015", 10 | "moduleResolution":"node", 11 | "esModuleInterop": true, 12 | "skipLibCheck": true, 13 | "forceConsistentCasingInFileNames": true, 14 | "resolveJsonModule": true, 15 | } 16 | } -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | 6 | # CDK asset staging directory 7 | .cdk.staging 8 | cdk.out 9 | -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/env.json: -------------------------------------------------------------------------------- 1 | { 2 | "Parameters": { 3 | "DYNAMODB_TABLE_NAME": "DynamoTable" 4 | } 5 | } -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/img/pattern_02_lambda_handler_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/lambda-handler-dynamodb/img/pattern_02_lambda_handler_test.png -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/lambda-handler-dynamodb/img/system-under-test.png -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | roots: ['/test'], 4 | testMatch: ['**/*.test.ts'], 5 | transform: { 6 | '^.+\\.tsx?$': 'ts-jest' 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /typescript-test-samples/lambda-handler-dynamodb/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "declaration": true, 9 | "strict": true, 10 | "noImplicitAny": true, 11 | "strictNullChecks": true, 12 | "noImplicitThis": true, 13 | "alwaysStrict": true, 14 | "noUnusedLocals": false, 15 | "noUnusedParameters": false, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": false, 18 | "inlineSourceMap": true, 19 | "inlineSources": true, 20 | "experimentalDecorators": true, 21 | "strictPropertyInitialization": false, 22 | "typeRoots": [ 23 | "./node_modules/@types" 24 | ] 25 | }, 26 | "exclude": [ 27 | "node_modules", 28 | "cdk.out" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | # CDK asset staging directory 4 | .cdk.staging 5 | cdk.out -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/.npmignore: -------------------------------------------------------------------------------- 1 | # CDK asset staging directory 2 | .cdk.staging 3 | cdk.out 4 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node' 3 | } 4 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/resources/lambdas/getFlagsStarter/index.mjs: -------------------------------------------------------------------------------- 1 | import LaunchDarkly from "launchdarkly-node-server-sdk"; 2 | export const handler = async (event) => { 3 | const client = LaunchDarkly.init( 4 | process.env.LAUNCHDARKLY_SDK_KEY 5 | ); 6 | await client.waitForInitialization(); 7 | const context = { 8 | kind: "user", 9 | key: "anonymous-1", 10 | anonymous: true 11 | }; 12 | const newFeature = await client.variation( 13 | "new-feature", 14 | context, 15 | false 16 | ); 17 | if (newFeature) { 18 | } else { 19 | } 20 | return newFeature; 21 | }; 22 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/resources/layers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/launchdarkly-lambda-dynamodb/cdk/resources/layers/.gitkeep -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/create-layer/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "launchdarkly-node-server-sdk": "^7.0.3", 4 | "launchdarkly-node-server-sdk-dynamodb": "^4.1.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/create-layer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "archiver": "^6.0.1" 4 | }, 5 | "scripts": { 6 | "build": "node index.js" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /typescript-test-samples/launchdarkly-lambda-dynamodb/img/LaunchDarkly-AWS-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/launchdarkly-lambda-dynamodb/img/LaunchDarkly-AWS-diagram.png -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features 5 | sourceType: 'module', 6 | }, 7 | extends: [ 8 | 'plugin:@typescript-eslint/recommended', // recommended rules from the @typescript-eslint/eslint-plugin 9 | 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. 10 | ], 11 | rules: { 12 | // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs 13 | // e.g. "@typescript-eslint/explicit-function-return-type": "off", 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: 'all', 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 2, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/events/event-1.0.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia" 6 | } 7 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/events/event-1.1.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "email": "jane.doe@amazon.com", 4 | "firstName": "Jane", 5 | "lastName": "Doe", 6 | "address": "2 Park St, Sydney, NSW 2000, Australia" 7 | } 8 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/events/event-1.2.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "name": "Jane Doe", 4 | "address": "2 Park St, Sydney, NSW 2000, Australia" 5 | } 6 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/events/event-1.3.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St", 6 | "city": "Sydney", 7 | "state": "NSW", 8 | "country": "Australia", 9 | "postcode": "2000" 10 | } 11 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/events/event-1.4.0.json: -------------------------------------------------------------------------------- 1 | { 2 | "customerId": "577af109-1f19-4d0a-9c56-359f44ca0034", 3 | "firstName": "Jane", 4 | "lastName": "Doe", 5 | "address": "2 Park St, Sydney, NSW 2000, Australia", 6 | "city": "", 7 | "state": "", 8 | "country": "", 9 | "postcode": "" 10 | } -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/img/contract_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/schema-and-contract-testing/img/contract_testing.png -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/img/schema_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/schema-and-contract-testing/img/schema_testing.png -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | transform: { 8 | '^.+\\.ts?$': 'esbuild-jest', 9 | }, 10 | clearMocks: true, 11 | collectCoverage: true, 12 | coverageDirectory: 'coverage', 13 | coverageProvider: 'v8', 14 | verbose: true, 15 | testMatch: ['**/tests/*.test.ts'], 16 | }; 17 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/src/address-validation.ts: -------------------------------------------------------------------------------- 1 | // Sample business logic code - we expect to have a full address in the "address" string, e.g. "2 Park St, Sydney, NSW 2000, Australia" 2 | export const isAddressValid = (event) => { 3 | if (!event || !event.address) return false; 4 | 5 | const addressWords = event.address.split(','); 6 | if (addressWords.length != 4) return false; 7 | 8 | return true; 9 | }; 10 | -------------------------------------------------------------------------------- /typescript-test-samples/schema-and-contract-testing/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": false, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "resolveJsonModule": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/events/sfn_valid_input.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": { 3 | "firstname": "Jane", 4 | "lastname": "Doe", 5 | "identity": { 6 | "email": "jdoe@example.com", 7 | "ssn": "123-45-6789" 8 | }, 9 | "address": { 10 | "street": "123 Main St", 11 | "city": "Columbus", 12 | "state": "OH", 13 | "zip": "43219" 14 | }, 15 | "comments": "I am glad to sign-up for this service. Looking forward to different options." 16 | } 17 | } -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/images/stepfunctions_local_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/step-functions-local/images/stepfunctions_local_test.png -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/images/system-under-test-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/step-functions-local/images/system-under-test-description.png -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ['/jest.sfnLocal.config.ts'], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | silent: true, 16 | testMatch: ['**/tests/sfnLocal/*.test.ts'], 17 | }; 18 | -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/jest.sfnLocal.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'unit', 3 | testMatch: ['**/tests/sfnLocal/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/step-functions-local/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": true, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module":"es2015", 9 | "moduleResolution":"node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "typeRoots": [ 14 | "./node_modules/@types" 15 | ] 16 | }, 17 | "exclude": ["node_modules", "**/*.test.ts"] 18 | } -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/img/system-under-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/typescript-test-samples/typescript-test-intro/img/system-under-test.png -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .aws-sam -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | semi: true, 3 | trailingComma: "all", 4 | singleQuote: true, 5 | printWidth: 120, 6 | tabWidth: 4 7 | }; -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * For a detailed explanation regarding each configuration property and type check, visit: 3 | * https://jestjs.io/docs/configuration 4 | */ 5 | 6 | export default { 7 | projects: ['/jest.integration.config.ts', '/jest.unit.config.ts'], 8 | transform: { 9 | '^.+\\.ts?$': 'esbuild-jest', 10 | }, 11 | clearMocks: true, 12 | collectCoverage: true, 13 | coverageDirectory: 'coverage', 14 | coverageProvider: 'v8', 15 | silent: true, 16 | testMatch: ['**/tests/unit/*.test.ts', '**/tests/integration/*.test.ts'], 17 | }; 18 | -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/jest.integration.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'integration', 3 | testMatch: ['**/tests/integration/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/jest.unit.config.ts: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | displayName: 'unit', 3 | testMatch: ['**/tests/unit/*.test.ts'], 4 | transform: { 5 | '^.+\\.ts?$': 'esbuild-jest', 6 | }, 7 | }; 8 | -------------------------------------------------------------------------------- /typescript-test-samples/typescript-test-intro/list-buckets/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2020", 4 | "strict": true, 5 | "preserveConstEnums": true, 6 | "noEmit": true, 7 | "sourceMap": false, 8 | "module":"es2015", 9 | "moduleResolution":"node", 10 | "esModuleInterop": true, 11 | "skipLibCheck": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "typeRoots": [ 14 | "./node_modules/@types" 15 | ] 16 | }, 17 | "exclude": ["node_modules", "**/*.test.ts"] 18 | } -------------------------------------------------------------------------------- /workshops/README.md: -------------------------------------------------------------------------------- 1 | # Serverless Test Workshops 2 | 3 | This portion of the repository contains code used in AWS workshops. The code is intended to accompany the workshop narratives, and therefore may not include full descriptions or complete code. 4 | See the workshop link associated with each project for more details. 5 | 6 | ## Workshop list 7 | |Project|Workshop Link|Description| 8 | ---|---|--- 9 | |[Serverless Testing Workshop Code](./serverless-testing-workshop)|[Serverless Testing Workshop Lab](https://catalog.us-east-1.prod.workshops.aws/workshops/0f9013f4-3960-426d-a445-dc3519b8e3d4)|A Lab demonstrating the basics of Unit Test, Local Test, and Integration Test| -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/Dockerfile: -------------------------------------------------------------------------------- 1 | # app/Dockerfile 2 | 3 | FROM python:3.11-slim 4 | WORKDIR /app 5 | RUN apt-get update && apt-get install -y \ 6 | build-essential \ 7 | curl \ 8 | software-properties-common \ 9 | git \ 10 | && rm -rf /var/lib/apt/lists/* 11 | 12 | # COPY . . 13 | ADD demo-app/urs-ui.py ./ui.py 14 | ADD demo-app/requirements.txt . 15 | ADD demo-app/_img ./_img 16 | RUN pip3 install -r requirements.txt 17 | 18 | EXPOSE 8501 19 | 20 | HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health 21 | 22 | ENTRYPOINT ["streamlit", "run", "ui.py", "--server.port=8501", "--server.address=0.0.0.0"] 23 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/_img/App_Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/workshops/serverless-testing-workshop/_img/App_Architecture.png -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/demo-app/_img/unicorn_art.md: -------------------------------------------------------------------------------- 1 | ``` 2 | . /((((((\\\\ 3 | =====(((<(((((((\ 4 | (( \ 5 | ( (@ _/ 6 | \ / \ 7 | | | | 8 | o_) / ``` -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/demo-app/config-orig.json: -------------------------------------------------------------------------------- 1 | {"api_endpoint": "https://y08ok3a5yl.execute-api.us-east-1.amazonaws.com/Prod/"} -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/demo-app/config.toml.cloud9only: -------------------------------------------------------------------------------- 1 | [server] 2 | headless = true 3 | port = 8080 4 | enableXsrfProtection=false 5 | enableCORS = false -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/demo-app/data/demo-data.csv: -------------------------------------------------------------------------------- 1 | Unicorn Name,Unicorn Location 2 | Sparkles,Unicornland 3 | Sprinkles,Unicornland 4 | Rainbow,Unicornland 5 | Glitter,Unicornland 6 | Stardust,Mythville 7 | Shimmer,Mythville 8 | Andromeda,Mythville 9 | Aurora,Mythville 10 | Ned,Unicornland -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/demo-app/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | boto3 3 | streamlit 4 | streamlit_js_eval -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/java/unicorn-reservation-system/src/main/java/com/myorg/urs/App.java: -------------------------------------------------------------------------------- 1 | package com.myorg.urs; 2 | 3 | public class App { 4 | 5 | public static void main(String... arguments) { 6 | System.out.println("Hello World!"); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/Checkout/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/CreateLocations/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/workshops/serverless-testing-workshop/src/CreateLocations/requirements.txt -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/FileValidator/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/FileValidator/schemas.py: -------------------------------------------------------------------------------- 1 | """ 2 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | # SPDX-License-Identifier: MIT-0 4 | """ 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/GetInventory/requirements.txt: -------------------------------------------------------------------------------- 1 | aws_xray_sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/GetLocations/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/src/GetSignedUrlForInventoryFilePost/requirements.txt: -------------------------------------------------------------------------------- 1 | aws-xray-sdk 2 | aws_lambda_powertools 3 | fastjsonschema -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/events/fv_test.json: -------------------------------------------------------------------------------- 1 | {"Unicorn Name" : "Hello Unicorn", 2 | "Unicorn Location" : "Hello Location"} -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/integration/dotnet/UnicornReservationSystem.Tests.Integration/Fixtures/EnvironmentCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved 3 | * 4 | * SPDX-License-Identifier: MIT-0 5 | */ 6 | 7 | using Xunit; 8 | 9 | namespace UnicornReservationSystem.Tests.Integration.Fixtures; 10 | 11 | /// 12 | /// This class has no code, and is never created. Its purpose is simply 13 | /// to be the place to apply [CollectionDefinition] and all the 14 | /// ICollectionFixture<T> interfaces. 15 | /// 16 | [CollectionDefinition("Environment")] 17 | public class EnvironmentCollection : ICollectionFixture; 18 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/integration/dotnet/UnicornReservationSystem.Tests.Integration/LocationTests.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved 3 | * 4 | * SPDX-License-Identifier: MIT-0 5 | */ 6 | 7 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/integration/dotnet/completed-solution/UnicornReservationSystem.Tests.Integration/Fixtures/EnvironmentCollection.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved 3 | * 4 | * SPDX-License-Identifier: MIT-0 5 | */ 6 | 7 | using Xunit; 8 | 9 | namespace UnicornReservationSystem.Tests.Integration.Fixtures; 10 | 11 | /// 12 | /// This class has no code, and is never created. Its purpose is simply 13 | /// to be the place to apply [CollectionDefinition] and all the 14 | /// ICollectionFixture<T> interfaces. 15 | /// 16 | [CollectionDefinition("Environment")] 17 | public class EnvironmentCollection : ICollectionFixture; 18 | -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/integration/src/test_locations.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/serverless-test-samples/75614a5b471b4fa19e478ad1ed6b523f01e334d7/workshops/serverless-testing-workshop/tests/integration/src/test_locations.py -------------------------------------------------------------------------------- /workshops/serverless-testing-workshop/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | moto==4.0.7 2 | pytest 3 | pytest-socket 4 | coverage 5 | validators 6 | boto3 7 | aws_lambda_powertools 8 | fastjsonschema 9 | pylint 10 | bandit 11 | aws-xray-sdk 12 | aws_lambda_powertools 13 | fastjsonschema 14 | --------------------------------------------------------------------------------