Skip to content

Instantly share code, notes, and snippets.

@MemoAlfa
Created October 1, 2019 16:16
Show Gist options
  • Save MemoAlfa/83ec48d247a81992bdcaaede6416f03c to your computer and use it in GitHub Desktop.
Save MemoAlfa/83ec48d247a81992bdcaaede6416f03c to your computer and use it in GitHub Desktop.
Integration Test Demo givenUploadTasksOnUserCreation
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);
assertThat(notificationMessageDtos.get(0).getUserId()).isEqualTo(testUserCreatedMessage.getUserUuid());
assertThat(response).containsExactlyInAnyOrderElementsOf(buildExpectedResponse(testUserCreatedMessage));
return Arrays.asList(response).stream().map(UserDocumentUploadTaskDto::getDocumentId).collect(Collectors.toList());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment