Skip to content

Instantly share code, notes, and snippets.

@pawelpluta
Last active March 3, 2020 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpluta/fbd7d38832d57b070f4a1a4394bd72b5 to your computer and use it in GitHub Desktop.
Save pawelpluta/fbd7d38832d57b070f4a1a4394bd72b5 to your computer and use it in GitHub Desktop.
class CustomerRepositoryTcLibraryIT extends Specification {
/* setup */
def "should be able to retrieve saved customer"() {
given:
CustomerId customerId = randomCustomerId()
Customer customer = customerForA(customerId)
and:
customerRepository.save(customer)
when:
Optional<Customer> foundCustomer = customerRepository.findById(customerId)
then:
foundCustomer.isPresent()
foundCustomer.get() == customer
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment