title: Running simple spray route test result: Could not initialize class spray.http.Uri$
body: <p>I am fairly new to spray . 
  I am trying to get the testing correctly so I used the example shown in <a href="http://spray.io/documentation/1.1-SNAPSHOT/spray-testkit/" rel="nofollow">spary testkit</a> however I am getting this errors. 
   any assistance will greatly appreciated 
  :</p>
  
  <pre><code>The service should
  
  Could not initialize class spray.http.Uri$
  java.lang.NoClassDefFoundError: Could not initialize class spray.http.Uri$
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:36)
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:34)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$2.apply(EventRouteTester.scala:38)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$2.apply(EventRouteTester.scala:38)
  
  return a 'PONG!' response for GET requests to /ping
  
  Could not initialize class spray.http.Uri$
  java.lang.NoClassDefFoundError: Could not initialize class spray.http.Uri$
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:36)
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:34)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$6.apply(EventRouteTester.scala:44)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$6.apply(EventRouteTester.scala:44)
  
  leave GET requests to other paths unhandled
  
  scala/collection/GenTraversableOnce$class
  java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
      at spray.http.Uri$Query.&lt;init&gt;(Uri.scala:496)
      at spray.http.Uri$Query$Empty$.&lt;init&gt;(Uri.scala:575)
      at spray.http.Uri$Query$Empty$.&lt;clinit&gt;(Uri.scala)
      at spray.http.parser.UriParser.&lt;init&gt;(UriParser.scala:37)
      at spray.http.Uri$.apply(Uri.scala:231)
      at spray.http.Uri$.apply(Uri.scala:203)
      at spray.http.Uri$.&lt;init&gt;(Uri.scala:194)
      at spray.http.Uri$.&lt;clinit&gt;(Uri.scala)
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:36)
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:34)
      at spray.httpx.RequestBuilding$RequestBuilder.apply(RequestBuilding.scala:33)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$9.apply(EventRouteTester.scala:50)
      at com.tr.route.EventRouteTester$$anonfun$3$$anonfun$apply$9.apply(EventRouteTester.scala:50)
  Caused by: java.lang.ClassNotFoundException: scala.collection.GenTraversableOnce$class
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      ... 13 more
  
  return a MethodNotAllowed error for PUT requests to the root path
  </code></pre>
  
  <p>this is the test class </p>
  
  <pre><code>class RouteTester extends Specification with Specs2RouteTest with HttpService {
    def actorRefFactory = system // connect the DSL to the test ActorSystem
  
    val smallRoute =
      get {
        pathSingleSlash {
          complete {
            &lt;html&gt;
              &lt;body&gt;
                &lt;h1&gt;Say hello to &lt;i&gt;spray&lt;/i&gt;!&lt;/h1&gt;
              &lt;/body&gt;
            &lt;/html&gt;
          }
        } ~
          path("ping") {
            complete("PONG!")
          }
      }
  
    "The service" should {
  
      "return a greeting for GET requests to the root path" in {
        Get() ~&gt; smallRoute ~&gt; check {
          responseAs[String] must contain("Say hello")
        }
      }
  
      "return a 'PONG!' response for GET requests to /ping" in {
        Get("/ping") ~&gt; smallRoute ~&gt; check {
          responseAs[String] === "PONG!"
        }
      }
  
      "leave GET requests to other paths unhandled" in {
        Get("/kermit") ~&gt; smallRoute ~&gt; check {
          handled must beFalse
        }
      }
  
      "return a MethodNotAllowed error for PUT requests to the root path" in {
        Put() ~&gt; sealRoute(smallRoute) ~&gt; check {
          status === MethodNotAllowed
          responseAs[String] === "HTTP method not allowed, supported methods: GET"
        }
      }
    }
  }
  </code></pre>
  
  <p>I am using maven 
  this are the dependencies and versions</p>
  
  <pre><code>  &lt;scala.version&gt;2.11.2&lt;/scala.version&gt;
          &lt;spray.version&gt;1.3.1&lt;/spray.version&gt;
          &lt;akka.version&gt;2.3.8&lt;/akka.version&gt;
  
        &lt;dependency&gt;
              &lt;groupId&gt;io.spray&lt;/groupId&gt;
              &lt;artifactId&gt;spray-can&lt;/artifactId&gt;
              &lt;version&gt;${spray.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.spray&lt;/groupId&gt;
              &lt;artifactId&gt;spray-routing&lt;/artifactId&gt;
              &lt;version&gt;${spray.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;io.spray&lt;/groupId&gt;
              &lt;artifactId&gt;spray-json_2.11&lt;/artifactId&gt;
              &lt;version&gt;${spray.version}&lt;/version&gt;
          &lt;/dependency&gt;
           &lt;dependency&gt;
              &lt;groupId&gt;io.spray&lt;/groupId&gt;
              &lt;artifactId&gt;spray-testkit_2.11&lt;/artifactId&gt;
               &lt;version&gt;${spray.version}&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>