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
### Keybase proof | |
I hereby claim: | |
* I am memoalfa on github. | |
* I am memoalfa (https://keybase.io/memoalfa) on keybase. | |
* I have a public key ASB6bF5kjvBbYvc9m5K2cbCkkXyTDjNrhW-HbCDbUd8lPQo | |
To claim this, I am signing this object: |
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 void givenResponseToGetUserInfo(UUID userUuid, UserInfoResponseDto userInfoResponseDto) { | |
mockServerClient.when(HttpRequest.request() | |
.withPath(String.format(USER_INFO_ENDPOINT, userUuid.toString())) | |
.withMethod(HttpMethod.GET.name()), Times.exactly(1)) | |
.respond(jsonResponse() | |
.withStatusCode(200) | |
.withBody(json(userInfoResponseDto))); | |
} | |
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
@Bean(destroyMethod = "shutdown") | |
@Primary | |
public AmazonSQS getSqsClient(@Value("${localstack.host}") String sqsHost, @Value("${localstack.tcp.4576}") String port) { | |
final AmazonSQSAsync sqsClient = | |
AmazonSQSAsyncClientBuilder.standard() | |
.withEndpointConfiguration( | |
new AwsClientBuilder.EndpointConfiguration(sqsHost + ":" + port, "cn-north-1")) | |
.withClientConfiguration(new ClientConfiguration().withProtocol(Protocol.HTTP)).build(); | |
return sqsClient; | |
} |
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
private void givenOperatorAcceptedAllDocuments(List<UUID> userDocumentUploadIds) { | |
userDocumentUploadIds.forEach(documentId -> | |
httpRequestHelper.whenPutVerifyDocumentAccepted(operatorUser(UUID.randomUUID()), documentId).then() | |
.statusCode(HttpStatus.ACCEPTED.value())); | |
} |
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
private void givenUserSuccessFullyUploadedRequiredDocuments(List<UUID> documentIds) throws IOException { | |
final UploadDocumentRequestDto uploadDocumentRequestDto = new UploadDocumentRequestDto( | |
Base64.getEncoder().encodeToString(ByteStreams.toByteArray(testDocumentPdf.getInputStream()))); | |
documentIds.forEach(documentId -> { | |
httpRequestHelper.whenPutUploadRequest(tenantUser(testUserCreatedMessage.getUserUuid()), documentId, uploadDocumentRequestDto) | |
.then() | |
.statusCode(HttpStatus.ACCEPTED.value()); | |
}); | |
} |
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
private List<UUID> givenUploadTasksOnUserCreation() { | |
sqsTestHelper.givenAPublishedUserCreatedMessageAwaitedToBeConsumed(testUserCreatedMessage); | |
final UserDocumentUploadTaskDto[] response = httpRequestHelper.whenGetUploadTasksForUser(tenantUser(testUserCreatedMessage.getUserUuid())) | |
.then() | |
.statusCode(HttpStatus.OK.value()) | |
.extract().body().as(UserDocumentUploadTaskDto[].class); | |
final List<NotificationMessageDto> notificationMessageDtos = sqsTestHelper.retrieveNotificationMessages(); | |
assertThat(notificationMessageDtos).hasSize(1); |
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
spring: | |
datasource: | |
url: jdbc:postgresql://${psql.host}:${psql.tcp.5432}/fake | |
username: postgres | |
password: fake | |
jpa: | |
flyway: | |
enabled: true | |
cloud: |
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
apply plugin: 'docker-compose' | |
apply plugin: 'com.adarshr.test-logger' | |
// ====== integration tests config | |
task integrationTest(type: Test) { | |
// injecting thoes as fake secrets whic is just one way to stop aws from failing on application startup | |
environment "AWS_ACCESS_KEY_ID", "fake" | |
environment "AWS_SECRET_ACCESS_KEY", "fake" | |
useJUnitPlatform { | |
// tagging our tests is a new way of distinguishing between tests in Junit5 Jupiters engine. |
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
buildscript { | |
ext { | |
springBootVersion = '2.1.4.RELEASE' | |
junitJupiterVersion = '5.3.2' | |
} | |
repositories { | |
maven { | |
url "https://plugins.gradle.org/m2/" | |
} | |
mavenCentral() |
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
version: '3' | |
services: | |
mockServer: | |
image: jamesdbloom/mockserver:mockserver-5.6.0 | |
ports: | |
- 1080 | |
environment: | |
- LOG_LEVEL=DEBUG # INFO | |
psql: |
NewerOlder