Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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