snowe
04/27/2017, 8:00 PM@Test
fun `AssetCreatedEvent results in event appending with "Asset Created"`() {
projector.handle(assetCreatedEvent())
`verify event is added`("Asset Created")
}
@Test
fun `ApplicantUpdatedEvent results in event appending with "Applicant Updated"`() {
projector.handle(applicantUpdatedEvent())
`verify event is added`("Applicant Updated")
}
etc...
fun `verify event is added`(text: String) {
verify(repository).save(saveCaptor.capture())
queue.add(LoanSummaryEvent(text, frozenInstant))
// we have to save the value because we create a new instance of the queue in the code
val actual = saveCaptor.value
assertEquals(loanTransactionId1, actual.loanTransactionId)
assertTrue(queue.contentEquals(actual.events))
}