Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Last active February 2, 2020 19:14
Show Gist options
  • Save pawelpluta/3f7c5f713e9df1c66cec8054c2f29bf5 to your computer and use it in GitHub Desktop.
Save pawelpluta/3f7c5f713e9df1c66cec8054c2f29bf5 to your computer and use it in GitHub Desktop.
def "registered user details should be available via REST"() {
given: "there is User Data"
String userId = randomAlphabetic(10)
String firstName = randomAlphabetic(10)
String lastName = randomAlphabetic(10)
and: "User Registered event contain user data"
UserRegisteredEvent userEvent = anUserRegisteredEvent()
.withUserId(userId).withFirstName(firstName).withLastName(lastName)
when: "User Registered event was published into kafka"
published(userEvent)
then: "User Details are available through REST API"
WAIT_FOR_PROCESSING.eventually {
userDetailsIsRequestedFor(userId).andExpect(jsonPath('$.displayName').value(firstName + " " + lastName))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment