Commit 0977ebed authored by Tom Käsler's avatar Tom Käsler

implement package/directory structure for tests

parent 070d242d
Pipeline #7860 passed with stage
in 2 minutes and 18 seconds
import services.BaseService
import models.User
package de.thm.arsnova
import de.thm.arsnova.services.BaseService
import de.thm.arsnova.models._
import de.thm.arsnova.utils.{DatabaseConfig, MigrationConfig}
import akka.event.{ NoLogging, LoggingAdapter }
import utils.MigrationConfig
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.duration._
import services.BaseService
import models._
import scala.language.existentials
import org.scalatest.BeforeAndAfterEach
import utils.DatabaseConfig
class BaseServiceSpec extends FunSpec with Matchers with MigrationConfig with BeforeAndAfterAll with DatabaseConfig
with BaseService with HateoasSpec with SessionApiSpec with QuestionApiSpec with FreetextAnswerApiSpec with ChoiceAnswerApiSpec with CommentApiSpec
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, SessionService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.ChoiceAnswerApi
import akka.http.scaladsl.model.{HttpEntity, MediaTypes, StatusCode}
import services.{BaseService, SessionService}
import models._
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import models._
import api.ChoiceAnswerApi
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.unmarshalling.Unmarshal
......@@ -13,7 +15,6 @@ import scala.concurrent.Future
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.Matchers
import services.BaseService
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.duration._
......@@ -21,7 +22,7 @@ import akka.http.scaladsl.server.MissingQueryParamRejection
trait ChoiceAnswerApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes
with TestData with ChoiceAnswerApi {
import mappings.ChoiceAnswerJsonProtocol._
import de.thm.arsnova.mappings.ChoiceAnswerJsonProtocol._
describe("ChoiceAnswer api") {
it("retrieve choice answers for question") {
Get("/question/5/choiceAnswer") ~> choiceAnswerApi ~> check {
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, SessionService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.CommentApi
import akka.http.scaladsl.model.{HttpEntity, MediaTypes, StatusCode}
import services.{BaseService, SessionService}
import models._
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import models._
import api.CommentApi
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.unmarshalling.Unmarshal
import scala.concurrent.Future
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.Matchers
import services.BaseService
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.{Future, Await}
import scala.concurrent.duration._
import akka.http.scaladsl.server.MissingQueryParamRejection
trait CommentApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes
with TestData with CommentApi {
import mappings.CommentJsonProtocol._
import de.thm.arsnova.mappings.CommentJsonProtocol._
describe("Comment api") {
it("retrieve comment by id") {
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, FeaturesService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.FeaturesApi
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.concurrent.ScalaFutures
import services.BaseService
import models._
import api.FeaturesApi
import services.FeaturesService
import spray.json._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.model.{HttpEntity, MediaTypes}
......@@ -12,7 +14,7 @@ import akka.http.scaladsl.model.StatusCodes._
trait FeaturesApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes
with TestData with FeaturesApi {
import mappings.FeatureJsonProtocol._
import de.thm.arsnova.mappings.FeatureJsonProtocol._
describe("Features api") {
it("retrieve features by id") {
Get("/features/1") ~> featuresApi ~> check {
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, SessionService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.FreetextAnswerApi
import akka.http.scaladsl.model.{HttpEntity, MediaTypes, StatusCode}
import services.{BaseService, SessionService}
import models._
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import models._
import api.FreetextAnswerApi
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.unmarshalling.Unmarshal
import scala.concurrent.Future
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.Matchers
import services.BaseService
import org.scalatest._
import scala.concurrent.Await
import scala.concurrent.{Future, Await}
import scala.concurrent.duration._
import akka.http.scaladsl.server.MissingQueryParamRejection
trait FreetextAnswerApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes
with TestData with FreetextAnswerApi {
import mappings.FreetextAnswerJsonProtocol._
import de.thm.arsnova.mappings.FreetextAnswerJsonProtocol._
describe("FreetextAnswer api") {
it("retrieve freetext answers for question") {
Get("/question/1/freetextAnswer") ~> freetextAnswerApi ~> check {
......
package de.thm.arsnova
import de.thm.arsnova.services.BaseService
import de.thm.arsnova.hateoas._
import de.thm.arsnova.api._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.{FunSpec, Matchers}
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import services.BaseService
import scala.concurrent.Future
import scala.concurrent.Await
import scala.concurrent.{Future, Await}
import scala.concurrent.duration._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.http.scaladsl.server.Route
import hateoas._
import api._
trait HateoasSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes {
import hateoas.LinkJsonProtocol._
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, SessionService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.QuestionApi
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import akka.http.scaladsl.unmarshalling._
import akka.http.scaladsl.model.{HttpEntity, MediaTypes, StatusCode}
import services.{BaseService, SessionService}
import models._
import api.QuestionApi
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import akka.http.scaladsl.server.Directives._
import scala.concurrent.Future
import scala.util.{Failure, Success}
import akka.http.scaladsl.model.StatusCodes._
......@@ -16,7 +18,7 @@ import akka.http.scaladsl.server.MissingQueryParamRejection
import org.scalatest.{FunSpec, Matchers}
trait QuestionApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes with TestData with QuestionApi {
import mappings.QuestionJsonProtocol._
import de.thm.arsnova.mappings.QuestionJsonProtocol._
// you need to call unmarshal because of the question trait
describe("Question api") {
it("retrieve question by id 1") {
......
package de.thm.arsnova
import de.thm.arsnova.services.{BaseService, SessionService}
import de.thm.arsnova.models._
import de.thm.arsnova.api.SessionApi
import akka.http.scaladsl.model.{HttpEntity, MediaTypes, StatusCode}
import services.{BaseService, SessionService}
import models._
import api.SessionApi
import org.scalatest.concurrent.ScalaFutures
import spray.json._
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
import models._
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.unmarshalling.Unmarshal
......@@ -13,12 +15,11 @@ import scala.concurrent.Future
import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.Matchers
import services.BaseService
import org.scalatest._
import akka.http.scaladsl.server.MissingQueryParamRejection
trait SessionApiSpec extends FunSpec with Matchers with ScalaFutures with BaseService with ScalatestRouteTest with Routes with TestData with SessionApi {
import mappings.SessionJsonProtocol._
import de.thm.arsnova.mappings.SessionJsonProtocol._
describe("Session api") {
it("retrieve sessions for user 1") {
......
import models._
package de.thm.arsnova
import de.thm.arsnova.models._
trait TestData {
val FOUR = 4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment