Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
pietrotull committed Dec 18, 2018
1 parent ced4f72 commit 0d4652a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 39 deletions.
27 changes: 0 additions & 27 deletions src/test/scala/io/sqooba/conf/GenGetterSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,6 @@ import org.scalatest.{FlatSpec, Matchers}
class GenGetterSpec extends FlatSpec with Matchers {

val conf: SqConf = new SqConf
/*
"use new getter for string" should "return same val" in {
val prop1 = conf.getString("some.testStringValue")
val prop2 = conf.getStringNew("some.testStringValue")
prop1 shouldBe prop2
}

"use new getter for int" should "return same val" in {
val prop1 = conf.getInt("some.testIntValue")
val prop2 = conf.getIntNew("some.testIntValue")
prop1 shouldBe prop2
}

"use new getter for long" should "return same val" in {
val long: Long = 100
val prop = conf.getLongNew("some.testLongValue")
long shouldBe prop
}
*/

"get duration list" should "give duration" in {
EnvUtil.removeEnv(conf.keyAsEnv("some.testDurationListValue"))
val duration: List[Duration] = conf.getListOfDuration("some.testDurationListValue")

val firstDuration: Duration = duration.head
val tenMinDuration: Duration = Duration.ofMinutes(10)

firstDuration shouldBe tenMinDuration
}
}
22 changes: 10 additions & 12 deletions src/test/scala/io/sqooba/conf/SqConfSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,6 @@ class SqConfSpec extends FlatSpec with Matchers {
duration shouldBe Duration.ofMinutes(10)
}

"get duration list" should "give duration" in {
EnvUtil.removeEnv(conf.keyAsEnv("some.testDurationListValue"))
val duration: List[Duration] = conf.getListOfDuration("some.testDurationListValue")

val firstDuration: Duration = duration.head
val tenMinDuration: Duration = Duration.ofMinutes(10)

firstDuration shouldBe tenMinDuration
//duration.head shouldBe Duration.ofMinutes(10)
// duration(1) shouldBe Duration.ofSeconds(100)
}

"get t" should "return parameterized type" in {
val intProp = conf.get[Int]("some.testIntValue")
intProp shouldBe a [java.lang.Integer] // does not work with scala.Int for some reason
Expand All @@ -102,4 +90,14 @@ class SqConfSpec extends FlatSpec with Matchers {
}
thrown.getMessage should include ("No configuration setting found for key")
}

"get duration list" should "give duration" in {
EnvUtil.removeEnv(conf.keyAsEnv("some.testDurationListValue"))
val duration: List[Duration] = conf.getListOfDuration("some.testDurationListValue")

val firstDuration: Duration = duration.head
val tenMinDuration: Duration = Duration.ofMinutes(10)

firstDuration shouldBe tenMinDuration
}
}

0 comments on commit 0d4652a

Please sign in to comment.