Skip to content

Commit

Permalink
Add tag to lar component test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredb96 committed Jun 26, 2024
1 parent aa7418a commit 2f918d5
Showing 1 changed file with 36 additions and 34 deletions.
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"
}

0 comments on commit 2f918d5

Please sign in to comment.