Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "A Transaction Service" should "return newly inserted transaction by id" in {
- for {
- r <- RetailerServiceTest.write(retailer) recover { case _ => insertError("retailer") }
- l <- LenderServiceTest.insert(lender) recover { case _ => insertError("lender") }
- transactionCopy = transaction.copy(retailer = transaction.retailer.copy(sid = r.sid), lenderSID = l.sid)
- t <- insert(transactionCopy) recover { case _ => insertError("transaction") }
- newTransaction <- findById(t.sfhTransactionId) getOrElse
- fail("Should return newly inserted transaction by id")
- } {
- import org.joda.time.format.DateTimeFormat
- val dateFmt = DateTimeFormat.forPattern("MM-dd-yyyy")
- val timeFmt = DateTimeFormat.forPattern("HH:mm:ss")
- newTransaction.retailerLocationId should be (transaction.retailerLocationId)
- newTransaction.terminalId should be (transaction.terminalId)
- newTransaction.retailerFileReferenceId should be (transaction.retailerFileReferenceId)
- newTransaction.settlementBatchId should be (transaction.settlementBatchId)
- newTransaction.sfhTransactionId should not be (transaction.sfhTransactionId)
- newTransaction.primaryAccountNumber should be (transaction.primaryAccountNumber)
- newTransaction.cardExpirationDate should be (transaction.cardExpirationDate)
- newTransaction.nclReferenceId should be (transaction.nclReferenceId)
- newTransaction.transactionAmount should be (transaction.transactionAmount)
- newTransaction.sfhCTransactionType should be (transaction.sfhCTransactionType)
- newTransaction.transactionDate.map(dateFmt.print(_)) should be (transaction.transactionDate.map(dateFmt.print(_)))
- newTransaction.transactionTime.map(timeFmt.print(_)) should be (transaction.transactionTime.map(timeFmt.print(_)))
- newTransaction.transactionDBADesc should be (transaction.transactionDBADesc)
- newTransaction.retailerTransactionId should be (transaction.retailerTransactionId)
- newTransaction.retailerTransactionDesc should be (transaction.retailerTransactionDesc)
- newTransaction.retailer.sid should be (r.sid)
- newTransaction.lenderSID should be (l.sid)
- newTransaction.authorizationId should be (transaction.authorizationId)
- newTransaction.promotionalCode should be (transaction.promotionalCode)
- newTransaction.sfhRMTransactionId should be (transaction.sfhRMTransactionId)
- newTransaction.settlementStatus should be (transaction.settlementStatus)
- newTransaction.currentFlag should be (transaction.currentFlag)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement