forked from akka/akka-http
/
SettingsEqualitySpec.scala
69 lines (53 loc) · 1.73 KB
/
SettingsEqualitySpec.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Copyright (C) 2017-2018 Lightbend Inc. <https://www.lightbend.com>
*/
package akka.http.scaladsl.settings
import com.typesafe.config.ConfigFactory
import org.scalatest.Matchers
import org.scalatest.WordSpec
class SettingsEqualitySpec extends WordSpec with Matchers {
val config = ConfigFactory.parseString("""
akka.http.routing {
verbose-error-messages = off
file-get-conditional = on
render-vanity-footer = yes
range-coalescing-threshold = 80
range-count-limit = 16
decode-max-bytes-per-chunk = 1m
decode-max-size = 8m
file-io-dispatcher = ${akka.stream.blocking-io-dispatcher}
}
""").withFallback(ConfigFactory.load).resolve
"equality" should {
"hold for ConnectionPoolSettings" in {
val s1 = ConnectionPoolSettings(config)
val s2 = ConnectionPoolSettings(config)
s1 shouldBe s2
s1.toString should startWith("ConnectionPoolSettings(")
}
"hold for ParserSettings" in {
val s1 = ParserSettings(config)
val s2 = ParserSettings(config)
s1 shouldBe s2
s1.toString should startWith("ParserSettings(")
}
"hold for ClientConnectionSettings" in {
val s1 = ClientConnectionSettings(config)
val s2 = ClientConnectionSettings(config)
s1 shouldBe s2
s1.toString should startWith("ClientConnectionSettings(")
}
"hold for RoutingSettings" in {
val s1 = RoutingSettings(config)
val s2 = RoutingSettings(config)
s1 shouldBe s2
s1.toString should startWith("RoutingSettings(")
}
"hold for ServerSettings" in {
val s1 = ServerSettings(config)
val s2 = ServerSettings(config)
s1 shouldBe s2
s1.toString should startWith("ServerSettings(")
}
}
}