|
Play Framework/Scala example source code file (DebugBuilderSpec.scala)
The DebugBuilderSpec.scala Play Framework example source code
/*
*
* * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*
*/
package play.api.libs.ws.ssl
import org.specs2.mutable._
object DebugBuilderSpec extends Specification {
"JavaSecurityDebugBuilder" should {
"match nothing by default" in {
val config = SSLDebugConfig(certpath = false)
val builder = new JavaSecurityDebugBuilder(config)
val actual = builder.build()
actual.trim must beEmpty
}
"match certpath" in {
val config = SSLDebugConfig(certpath = true)
val builder = new JavaSecurityDebugBuilder(config)
val actual = builder.build()
actual.trim.split("\\s+").toSeq must containTheSameElementsAs(Seq("certpath"))
}
"match certpath + ocsp" in {
val config = SSLDebugConfig(certpath = true, ocsp = true)
val builder = new JavaSecurityDebugBuilder(config)
val actual = builder.build()
actual.trim.split("\\s+").toSeq must containTheSameElementsAs(Seq("certpath", "ocsp"))
}
}
"JavaxNetDebugBuilder" should {
"match nothing by default" in {
val config = SSLDebugConfig()
val builder = new JavaxNetDebugBuilder(config)
val actual = builder.build()
actual.trim must beEmpty
}
"match all" in {
val config = SSLDebugConfig(all = true)
val builder = new JavaxNetDebugBuilder(config)
val actual = builder.build()
actual.trim.split("\\s+").toSeq must containTheSameElementsAs(Seq("all"))
}
"match some random combinations" in {
val config = SSLDebugConfig(ssl = true, defaultctx = true, handshake = Some(SSLDebugHandshakeOptions(data = true)))
val builder = new JavaxNetDebugBuilder(config)
val actual:String = builder.build()
actual.trim.split("\\s+").toSeq must containTheSameElementsAs(Seq("ssl", "defaultctx", "handshake", "data"))
}
}
}
Other Play Framework source code examplesHere is a short list of links related to this Play Framework DebugBuilderSpec.scala source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.