Skip to content

#64: Fixed some of test compile errors #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import akka.http.scaladsl.unmarshalling._
import org.zalando.jsonapi.model._
import org.zalando.jsonapi.sprayjson.SprayJsonJsonapiProtocol
import org.zalando.jsonapi.{JsonapiRootObjectReader, JsonapiRootObjectWriter, _}
import spray.json._
import _root_.spray.json._
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it, why do we have to add it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it's not actually required to get sbt compile to work, but IntelliJ Idea thinks that we're refering to package org.zalando.jsonapi.spray.json which does not exist.

It's because on previous line there's include for import org.zalando.jsonapi._

Also this would work in both Idea and SBT

import org.zalando.jsonapi.{JsonapiRootObjectReader, JsonapiRootObjectWriter, ToJsonapiRootObjectWriterOps}
import spray.json._

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have understood to mention that I was also fixing errors in Idea by adding _root_ to some of the imports.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to merge this PR first?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take the approach of merging these changes as small individual pull requests to make it easier to review. This one should be independent of pull request #85 and can be merged at will :)


trait AkkaHttpJsonapiSupport extends SprayJsonJsonapiProtocol {
def akkaHttpJsonapiMarshaller[T: JsonapiRootObjectWriter]: ToEntityMarshaller[T] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import org.scalatest.{EitherValues, WordSpec}
import org.zalando.jsonapi.JsonapiRootObjectWriter
import org.zalando.jsonapi.model._
import org.zalando.jsonapi._
import org.zalando.jsonapi.akka.http.AkkaHttpJsonapiSupport
import spray.json._
import _root_.spray.json._

class AkkaHttpJsonapiSupportSpec extends WordSpec with TypeCheckedTripleEquals with EitherValues with AkkaHttpJsonapiSupport {
s"AkkaHttpJsonapiSupport" must {
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ object Dependencies {

lazy val sprayJsonDeps = Seq(sprayJson)

lazy val akkaHttpDeps = Seq(akkaHttpCore, akkaHttpExperimental, sprayJson)
lazy val akkaHttpDeps = Seq(akkaHttpCore, akkaHttpExperimental, akkaHttpTestkit, sprayJson)
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.zalando.jsonapi.json
package org.zalando.jsonapi.sprayjson

import org.scalatest.{MustMatchers, WordSpec}
import org.zalando.jsonapi.model.JsonApiObject.StringValue
import org.zalando.jsonapi.model.RootObject.ResourceObject
import org.zalando.jsonapi.model.{Attribute, Links, RootObject}
import org.zalando.jsonapi.sprayjson.SprayJsonJsonapiProtocol
import org.zalando.jsonapi.{JsonapiRootObjectWriter, _}
import spray.json._
import _root_.spray.json._
import org.zalando.jsonapi.json.Person

class ExampleSpec extends WordSpec with MustMatchers with SprayJsonJsonapiProtocol {
"JsonapiRootObject" when {
Expand Down