File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
publication/src/test/scala/hmda/publication/reports/util Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
package hmda .publication .reports .util
2
2
3
+ import akka .actor .ActorSystem
4
+ import akka .stream .ActorMaterializer
5
+ import akka .stream .scaladsl .Source
6
+ import hmda .model .fi .lar .LarGenerators
3
7
import hmda .model .publication .reports .MSAReport
4
8
import hmda .publication .reports .util .ReportUtil ._
9
+ import hmda .query .repository .filing .LarConverter ._
5
10
import org .scalatest .{ AsyncWordSpec , MustMatchers }
6
11
7
- class ReportUtilSpec extends AsyncWordSpec with MustMatchers {
12
+ class ReportUtilSpec extends AsyncWordSpec with MustMatchers with LarGenerators {
13
+
14
+ implicit val system = ActorSystem ()
15
+ implicit val ec = system.dispatcher
16
+ implicit val materializer = ActorMaterializer ()
8
17
9
18
" msaReport" must {
10
19
" get MSA info for given fips code and return MSAReport object" in {
@@ -31,4 +40,15 @@ class ReportUtilSpec extends AsyncWordSpec with MustMatchers {
31
40
}
32
41
}
33
42
43
+ " calculateYear" must {
44
+ " given a larSource, return the Activity Year for the LARs in it" in {
45
+ // Activity Year is the same year as Action Taken Date. This is enforced by edit S270
46
+ val lars = larListGen.sample.get.map(_.copy(actionTakenDate = 20090822 ))
47
+ val src = Source .fromIterator(() => lars.toIterator)
48
+ .map(lar => toLoanApplicationRegisterQuery(lar))
49
+
50
+ calculateYear(src).map(_ mustBe 2009 )
51
+ }
52
+ }
53
+
34
54
}
You can’t perform that action at this time.
0 commit comments