aboutsummaryrefslogtreecommitdiff
path: root/kamon-core-tests
diff options
context:
space:
mode:
authorDiego <diegolparra@gmail.com>2017-08-22 11:56:12 -0300
committerDiego <diegolparra@gmail.com>2017-08-22 11:56:12 -0300
commitd5719438ed9a93c4035262fa8bd94ee60eead048 (patch)
treeabfb32d21fde80ba370822f039cc56f74a70fb7f /kamon-core-tests
parent670f32d19a30283a39a0519a74fc5c6a0efd379b (diff)
downloadKamon-d5719438ed9a93c4035262fa8bd94ee60eead048.tar.gz
Kamon-d5719438ed9a93c4035262fa8bd94ee60eead048.tar.bz2
Kamon-d5719438ed9a93c4035262fa8bd94ee60eead048.zip
move kamon.context.SimpleStringCodec to kamon.testkit.SimpleStringCodec in order to avoid java.lang.ClassNotFoundException: kamon.context.SimpleStringCodec in tests
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