From b77454ed16d2d01c2eea340dc0524aba1c962a4d Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Mon, 24 Mar 2014 23:56:07 -0300 Subject: ensure that kamon.trace.ask-pattern-tracing setting is honored, closes #4 --- .../instrumentation/AskPatternTracingSpec.scala | 37 ++++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) (limited to 'kamon-core/src/test/scala/kamon/trace') diff --git a/kamon-core/src/test/scala/kamon/trace/instrumentation/AskPatternTracingSpec.scala b/kamon-core/src/test/scala/kamon/trace/instrumentation/AskPatternTracingSpec.scala index 04a5c0e3..fb886de6 100644 --- a/kamon-core/src/test/scala/kamon/trace/instrumentation/AskPatternTracingSpec.scala +++ b/kamon-core/src/test/scala/kamon/trace/instrumentation/AskPatternTracingSpec.scala @@ -1,21 +1,22 @@ -/* =================================================== +/* + * ========================================================================================= * Copyright © 2013 the kamon project * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ + * Unless required by applicable law or agreed to in writing, software distributed under the + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + * ========================================================================================= + */ + package kamon.trace.instrumentation -import akka.testkit.TestKit +import akka.testkit.TestKitBase import akka.actor.{ Props, Actor, ActorSystem } import org.scalatest.{ Matchers, WordSpecLike } import akka.event.Logging.Warning @@ -23,9 +24,17 @@ import scala.concurrent.duration._ import akka.pattern.ask import akka.util.Timeout import kamon.trace.{ TraceContextAware, TraceRecorder } -import org.scalatest.OptionValues._ +import com.typesafe.config.ConfigFactory -class AskPatternTracingSpec extends TestKit(ActorSystem("ask-pattern-tracing-spec")) with WordSpecLike with Matchers { +class AskPatternTracingSpec extends TestKitBase with WordSpecLike with Matchers { + implicit lazy val system: ActorSystem = ActorSystem("ask-pattern-tracing-spec", ConfigFactory.parseString( + """ + |kamon { + | trace { + | ask-pattern-tracing = on + | } + |} + """.stripMargin)) "the AskPatternTracing" should { "log a warning with a stack trace and TraceContext taken from the moment the ask was triggered" in { -- cgit v1.2.3