fix the bug: broken test
diff --git a/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala b/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
index ef01d52..dc578bb 100644
--- a/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
+++ b/s2graphql/src/test/scala/org/apache/s2graph/graphql/TestGraph.scala
@@ -85,7 +85,7 @@
override def cleanup(): Unit = graph.shutdown(true)
- override def schema: Schema[GraphRepository, Any] = new SchemaDef(s2Repository).S2GraphSchema
+ override def schema: Schema[GraphRepository, Any] = new SchemaDef(s2Repository).schema
override def showSchema: String = SchemaRenderer.renderSchema(schema)
diff --git a/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala b/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
index 26a7045..42ddda0 100644
--- a/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
+++ b/s2http/src/test/scala/org/apache/s2graph/http/AdminRouteSpec.scala
@@ -12,12 +12,16 @@
import play.api.libs.json.{JsString, JsValue, Json}
class AdminRoutesSpec extends WordSpec with Matchers with ScalaFutures with ScalatestRouteTest with S2GraphAdminRoute with BeforeAndAfterAll {
- val config = ConfigFactory.load()
- val s2graph = new S2Graph(config)
+ import scala.collection.JavaConverters._
+
+ val dbUrl = "jdbc:h2:file:./var/metastore_admin_route;MODE=MYSQL;AUTO_SERVER=true"
+ val config =
+ ConfigFactory.parseMap(Map("db.default.url" -> dbUrl).asJava)
+ lazy val s2graph = new S2Graph(config.withFallback(ConfigFactory.load()))
override val logger = LoggerFactory.getLogger(this.getClass)
override def afterAll(): Unit = {
- s2graph.shutdown()
+ s2graph.shutdown(true)
}
lazy val routes = adminRoute
diff --git a/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala b/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
index 943db98..7a3d2ab 100644
--- a/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
+++ b/s2http/src/test/scala/org/apache/s2graph/http/MutateRouteSpec.scala
@@ -4,6 +4,7 @@
import akka.http.scaladsl.model._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import com.typesafe.config.ConfigFactory
+import org.apache.s2graph.core.Management.JsonModel.Prop
import org.apache.s2graph.core.S2Graph
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpec}
@@ -11,12 +12,17 @@
import play.api.libs.json.{JsValue, Json}
class MutateRouteSpec extends WordSpec with Matchers with PlayJsonSupport with ScalaFutures with ScalatestRouteTest with S2GraphMutateRoute with BeforeAndAfterAll {
- val config = ConfigFactory.load()
- val s2graph = new S2Graph(config)
+
+ import scala.collection.JavaConverters._
+
+ val dbUrl = "jdbc:h2:file:./var/metastore_mutate_route;MODE=MYSQL;AUTO_SERVER=true"
+ val config =
+ ConfigFactory.parseMap(Map("db.default.url" -> dbUrl).asJava)
+ lazy val s2graph = new S2Graph(config.withFallback(ConfigFactory.load()))
override val logger = LoggerFactory.getLogger(this.getClass)
override def afterAll(): Unit = {
- s2graph.shutdown()
+ s2graph.shutdown(true)
}
lazy val routes = mutateRoute
@@ -28,6 +34,7 @@
"be able to insert vertex (POST /mutate/vertex/insert)" in {
s2graph.management.createService(serviceName, "localhost", s"${serviceName}-dev", 1, None)
+ s2graph.management.createServiceColumn(serviceName, columnName, "string", Seq(Prop("age", "0", "integer")))
// {"timestamp": 10, "serviceName": "s2graph", "columnName": "user", "id": 1, "props": {}}
val param = Json.obj(