@@ -11,12 +11,11 @@ import hmda.model.publication.reports.{ EthnicityBorrowerCharacteristic, MSARepo
11
11
import hmda .query .model .filing .LoanApplicationRegisterQuery
12
12
import hmda .query .repository .filing .LarConverter ._
13
13
import org .scalacheck .Gen
14
- import org .scalatest .{ MustMatchers , WordSpec }
14
+ import org .scalatest .{ AsyncWordSpec , MustMatchers }
15
15
16
- import scala .concurrent .{ Await , Future }
17
- import scala .concurrent .duration ._
16
+ import scala .concurrent .Future
18
17
19
- class D51Spec extends WordSpec with MustMatchers with LarGenerators {
18
+ class D51Spec extends AsyncWordSpec with MustMatchers with LarGenerators {
20
19
21
20
implicit val system = ActorSystem ()
22
21
implicit val ec = system.dispatcher
@@ -40,27 +39,28 @@ class D51Spec extends WordSpec with MustMatchers with LarGenerators {
40
39
val expectedDispositions = List (ApplicationReceived , LoansOriginated , ApprovedButNotAccepted , ApplicationsDenied , ApplicationsWithdrawn , ClosedForIncompleteness )
41
40
42
41
" Generate a Disclosure 5-1 report" in {
43
- val result = Await .result( D51 .generate(source, fips, respId, Future (" Corvallis Test Bank" )), 5 .seconds)
42
+ D51 .generate(source, fips, respId, Future (" Corvallis Test Bank" )).map { result =>
44
43
45
- result.msa mustBe MSAReport (" 18700" , " Corvallis, OR" , " OR" , " Oregon" )
46
- result.table mustBe " 5-1"
47
- result.respondentId mustBe " 98765"
48
- result.institutionName mustBe " Corvallis Test Bank"
49
- result.applicantIncomes.size mustBe 5
44
+ result.msa mustBe MSAReport (" 18700" , " Corvallis, OR" , " OR" , " Oregon" )
45
+ result.table mustBe " 5-1"
46
+ result.respondentId mustBe " 98765"
47
+ result.institutionName mustBe " Corvallis Test Bank"
48
+ result.applicantIncomes.size mustBe 5
50
49
51
- val lowestIncome = result.applicantIncomes.head
52
- lowestIncome.applicantIncome mustBe LessThan50PercentOfMSAMedian
50
+ val lowestIncome = result.applicantIncomes.head
51
+ lowestIncome.applicantIncome mustBe LessThan50PercentOfMSAMedian
53
52
54
- val races = lowestIncome.borrowerCharacteristics.head.asInstanceOf [RaceBorrowerCharacteristic ].races
55
- races.size mustBe 8
53
+ val races = lowestIncome.borrowerCharacteristics.head.asInstanceOf [RaceBorrowerCharacteristic ].races
54
+ races.size mustBe 8
56
55
57
- val ethnicities = lowestIncome.borrowerCharacteristics(1 ).asInstanceOf [EthnicityBorrowerCharacteristic ].ethnicities
58
- ethnicities.size mustBe 4
56
+ val ethnicities = lowestIncome.borrowerCharacteristics(1 ).asInstanceOf [EthnicityBorrowerCharacteristic ].ethnicities
57
+ ethnicities.size mustBe 4
59
58
60
- val minorityStatuses = lowestIncome.borrowerCharacteristics(2 ).asInstanceOf [MinorityStatusBorrowerCharacteristic ].minoritystatus
61
- minorityStatuses.size mustBe 2
59
+ val minorityStatuses = lowestIncome.borrowerCharacteristics(2 ).asInstanceOf [MinorityStatusBorrowerCharacteristic ].minoritystatus
60
+ minorityStatuses.size mustBe 2
62
61
63
- races.head.dispositions.map(_.disposition) mustBe expectedDispositions
62
+ races.head.dispositions.map(_.disposition) mustBe expectedDispositions
63
+ }
64
64
}
65
65
66
66
}
0 commit comments