-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
34 deletions.
There are no files selected for viewing
70 changes: 36 additions & 34 deletions
70
hmda-analytics/src/test/scala/hmda/analytics/query/LarComponentSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
//package hmda.analytics.query | ||
// | ||
//import hmda.model.filing.lar.LarGenerators._ | ||
//import hmda.utils.EmbeddedPostgres | ||
//import org.scalatest.{AsyncWordSpec, BeforeAndAfter, MustMatchers} | ||
// | ||
//class LarComponentSpec extends AsyncWordSpec with LarComponent with EmbeddedPostgres with MustMatchers with BeforeAndAfter { | ||
// | ||
// "LarComponent" must { | ||
// "be able to persist and delete a 2019 LAR" in { | ||
// val repo = new LarRepository(dbConfig, "loanapplicationregister2019") // as per hmda.sql | ||
// val sampleLar = larGen.map(LarConverter(_, year = 2019)).sample.get | ||
// | ||
// repo | ||
// .insert(sampleLar) | ||
// .map(_ mustBe 1) | ||
// .flatMap(_ => repo.deleteByLei(sampleLar.lei)) | ||
// .map(_ mustBe 1) | ||
// } | ||
// | ||
// "be able to persist and delete a quarterly 2019 LAR" in { | ||
// val repo = new LarRepository(dbConfig, "loanapplicationregister2019") // as per hmda.sql | ||
// val sampleLar = larGen.map(LarConverter(_, year = 2019)).sample.get.copy(isQuarterly = true) | ||
// | ||
// repo | ||
// .insert(sampleLar) | ||
// .map(_ mustBe 1) | ||
// .flatMap(_ => repo.deletebyLeiAndQuarter(sampleLar.lei)) | ||
// .map(_ mustBe 1) | ||
// } | ||
// } | ||
// | ||
// override def bootstrapSqlFile: String = "hmda.sql" | ||
//} | ||
package hmda.analytics.query | ||
|
||
import hmda.model.filing.lar.LarGenerators._ | ||
import hmda.utils.EmbeddedPostgres | ||
import org.scalatest.{AsyncWordSpec, BeforeAndAfter, MustMatchers, Tag} | ||
|
||
object CustomTag extends Tag("actions-ignore") | ||
|
||
class LarComponentSpec extends AsyncWordSpec with LarComponent with EmbeddedPostgres with MustMatchers with BeforeAndAfter { | ||
|
||
"LarComponent" must { | ||
"be able to persist and delete a 2019 LAR" taggedAs CustomTag in { | ||
val repo = new LarRepository(dbConfig, "loanapplicationregister2019") // as per hmda.sql | ||
val sampleLar = larGen.map(LarConverter(_, year = 2019)).sample.get | ||
|
||
repo | ||
.insert(sampleLar) | ||
.map(_ mustBe 1) | ||
.flatMap(_ => repo.deleteByLei(sampleLar.lei)) | ||
.map(_ mustBe 1) | ||
} | ||
|
||
"be able to persist and delete a quarterly 2019 LAR" taggedAs CustomTag in { | ||
val repo = new LarRepository(dbConfig, "loanapplicationregister2019") // as per hmda.sql | ||
val sampleLar = larGen.map(LarConverter(_, year = 2019)).sample.get.copy(isQuarterly = true) | ||
|
||
repo | ||
.insert(sampleLar) | ||
.map(_ mustBe 1) | ||
.flatMap(_ => repo.deletebyLeiAndQuarter(sampleLar.lei)) | ||
.map(_ mustBe 1) | ||
} | ||
} | ||
|
||
override def bootstrapSqlFile: String = "hmda.sql" | ||
} |