This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_httpHandlerMock.Protected().Setup<Task<HttpResponseMessage>>( | |
"SendAsync", | |
ItExpr.Is<HttpRequestMessage>(rm => rm.RequestUri.AbsoluteUri.EndsWith("/getStudentDetails/{identifier}"), | |
ItExpr.IsAny<CancellationToken> ()).ReturnsAsync(mockedStudentDetailsResponse)); | |
_httpHandlerMock.Protected().Setup<Task<HttpResponseMessage>>( | |
"SendAsync", | |
ItExpr.Is<HttpRequestMessage>(rm => rm.RequestUri.AbsoluteUri.EndsWith("/getStudentGrades/{identifier}"), | |
ItExpr.IsAny<CancellationToken> ()).ReturnsAsync(mockedStudentGradesResponse)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mockedResponseMessage = new HttpResponseMessage { | |
StatusCode = HttpStatusCode.OK, | |
Content = new StringContent("mocked-response-data-as-string-here") | |
}; | |
_httpHandlerMock | |
.Protected() | |
.Setup<Task<HttpResponseMessage>>( | |
"SendAsync", | |
ItExpr.IsAny<HttpRequestMessage>(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<StudentData> GetStudentData(string studentIdentifier) | |
{ | |
var studentDetailsRequest = new HttpRequestMessage | |
{ | |
RequestUri = new Uri($ "{_httpClient.BaseAddress}/getStudentDetails/{studentIdentifier}"), | |
Method = HttpMethod.Get, | |
}; | |
var studentDetailsRawResponse = await _httpClient.SendAsync(studentDetailsRequest); | |
var studentGradesRequest = new HttpRequestMessage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
declare -r bucketName="aws-pipeline-bucket" | |
declare -r region="eu-west-1" | |
declare -r stackName="aws-pipeline" | |
declare -r pipelinesFolderPath="./aws-pipelines" | |
declare -r pathToTemplate="<the-path-of-the-pipeline-template>" | |
handleResponse() { | |
if [ $1 -eq 0 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws cloudformation package --template-file ./my-pipeline-root.yml --output-template ./my-packed-pipeline.yml --s3-bucket $bucketName && | |
aws cloudformation deploy --template-file ./my-packed-pipeline.yml --stack-name my-stack-name --capabilities CAPABILITY_NAMED_IAM --region <my-region> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Resources: | |
MyFirstPipeline: | |
Type: AWS::CloudFormation::Stack | |
Properties: | |
TemplateURL: https://s3.eu-west-1.amazonaws.com/my-bucket-name/<some-random-guid>.template | |
MySecondPipeline: | |
Type: AWS::CloudFormation::Stack | |
Properties: | |
TemplateURL: https://s3.eu-west-1.amazonaws.com/my-bucket-name/<some-random-guid>.template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Resources: | |
MyFirstpipeline: | |
Type: AWS::CloudFormation::Stack | |
Properties: | |
TemplateURL: ./my-first-pipeline.yml | |
MySecondPipeline: | |
Type: AWS::CloudFormation::Stack | |
Properties: | |
TemplateURL: ./my-second-pipeline.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service:my service | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
region: my-region | |
profile: default | |
apiGateway: | |
binaryMediaTypes: | |
- "application/octet-stream" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Parameters: | |
BranchName: | |
Description: CodeCommit branch name | |
Type: String | |
Default: master | |
RepositoryName: | |
Description: CodeCommit repository name | |
Type: String | |
Default: my-codecommit-repository-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service:my service | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
region: my-region | |
profile: default | |
apiGateway: | |
binaryMediaTypes: | |
- "application/octet-stream" |
NewerOlder