aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests
diff options
context:
space:
mode:
authorIvan Topolnjak <ivantopo@gmail.com>2017-08-24 11:21:50 +0200
committerIvan Topolnjak <ivantopo@gmail.com>2017-08-24 11:21:50 +0200
commit5291089bcc6bb048dcecad2c931f3408bd539574 (patch)
tree4885a7200242f9a2076dd3414170f36026de7cca /kamon-core-tests
parenteaa4f83b5b2c6335e7cf6cecc10bfe4de9f47533 (diff)
parentd5719438ed9a93c4035262fa8bd94ee60eead048 (diff)
downloadKamon-5291089bcc6bb048dcecad2c931f3408bd539574.tar.gz
Kamon-5291089bcc6bb048dcecad2c931f3408bd539574.tar.bz2
Kamon-5291089bcc6bb048dcecad2c931f3408bd539574.zip
Merge branch 'kamon-1.0-develop' of github.com:kamon-io/Kamon into kamon-1.0-develop
Diffstat (limited to 'kamon-core-tests')
-rw-r--r--kamon-core-tests/src/test/scala/kamon/context/ContextCodecSpec.scala42
1 files changed, 1 insertions, 41 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/context/ContextCodecSpec.scala b/kamon-core-tests/src/test/scala/kamon/context/ContextCodecSpec.scala
index ceac4e58..ab71814f 100644
--- a/kamon-core-tests/src/test/scala/kamon/context/ContextCodecSpec.scala
+++ b/kamon-core-tests/src/test/scala/kamon/context/ContextCodecSpec.scala
@@ -1,7 +1,5 @@
package kamon.context
-import java.nio.ByteBuffer
-
import kamon.Kamon
import kamon.testkit.ContextTesting
import org.scalatest.{Matchers, OptionValues, WordSpec}
@@ -69,42 +67,4 @@ class ContextCodecSpec extends WordSpec with Matchers with ContextTesting with O
}
val ContextCodec = new Codecs(Kamon.config())
-}
-
-object SimpleStringCodec {
- final class Headers extends Codecs.ForEntry[TextMap] {
- private val dataKey = "X-String-Value"
-
- override def encode(context: Context): TextMap = {
- val textMap = TextMap.Default()
- context.get(ContextTesting.StringBroadcastKey).foreach { value =>
- textMap.put(dataKey, value)
- }
-
- textMap
- }
-
- override def decode(carrier: TextMap, context: Context): Context = {
- carrier.get(dataKey) match {
- case value @ Some(_) => context.withKey(ContextTesting.StringBroadcastKey, value)
- case None => context
- }
- }
- }
-
- final class Binary extends Codecs.ForEntry[ByteBuffer] {
- val emptyBuffer = ByteBuffer.allocate(0)
-
- override def encode(context: Context): ByteBuffer = {
- context.get(ContextTesting.StringBroadcastKey) match {
- case Some(value) => ByteBuffer.wrap(value.getBytes)
- case None => emptyBuffer
- }
- }
-
- override def decode(carrier: ByteBuffer, context: Context): Context = {
- context.withKey(ContextTesting.StringBroadcastKey, Some(new String(carrier.array())))
- }
- }
-
-}
+} \ No newline at end of file