Skip to content

Commit

Permalink
ci: update version after release
Browse files Browse the repository at this point in the history
  • Loading branch information
MongoCamp CI committed Oct 23, 2023
1 parent 18602ab commit 507ef97
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package dev.mongocamp.server.database

import better.files.{File, Resource}
import better.files.{ File, Resource }
import dev.mongocamp.driver.mongodb._
import dev.mongocamp.server.converter.CirceSchema
import dev.mongocamp.server.model.ModelConstants
import dev.mongocamp.server.service.SystemFileService
import dev.mongocamp.server.test.CountingTestJob
import dev.mongocamp.server.test.client.api.{AdminApi, JobsApi}
import dev.mongocamp.server.test.client.api.{ AdminApi, JobsApi }
import dev.mongocamp.server.test.client.model._
import org.joda.time.DateTime
import sttp.client3.HttpClientSyncBackend
Expand Down Expand Up @@ -71,10 +71,10 @@ object TestAdditions extends CirceSchema {

def insertUsersAndRoles() = {
if (!dataImported) {
val userDao = MapCollectionDao(MongoDatabase.CollectionNameUsers)
val apiKey = "special"
val userDao = MapCollectionDao(MongoDatabase.CollectionNameUsers)
val apiKey = "special"
val apiUserID = "insertApiUser"
val apiUser = Map("userId" -> apiUserID, "password" -> "invalidPwd", "apiKey" -> apiKey, "roles" -> List("adminRole"))
val apiUser = Map("userId" -> apiUserID, "password" -> "invalidPwd", "apiKey" -> apiKey, "roles" -> List("adminRole"))
userDao.insertOne(apiUser).result()
val addUserRequest = AdminApi().addUser(null, null, null, apiKey)(UserInformation(testUser, testPassword, None, List("test")))
val addUserResponse = backend.send(addUserRequest)
Expand All @@ -98,7 +98,16 @@ object TestAdditions extends CirceSchema {
val updatePasswordResponse = backend.send(updatePasswordRequest)

val registerJobRequest =
JobsApi().registerJob(null, null, null, apiKey)(JobConfig("CountingTestJob", classOf[CountingTestJob].getName, "", "0/5 * * ? * * *", ModelConstants.jobDefaultGroup, ModelConstants.jobDefaultPriority))
JobsApi().registerJob(null, null, null, apiKey)(
JobConfig(
"CountingTestJob",
classOf[CountingTestJob].getName,
"",
"0/5 * * ? * * *",
ModelConstants.jobDefaultGroup,
ModelConstants.jobDefaultPriority
)
)
val registerJobResponse = backend.send(registerJobRequest)

val deleteResult = userDao.deleteMany(Map("userId" -> apiUserID)).resultOption()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.mongocamp.server.test

import dev.mongocamp.server.test.CountingTestJob.counter
import org.quartz.{Job, JobExecutionContext}
import org.quartz.{ Job, JobExecutionContext }
class CountingTestJob extends Job {

override def execute(context: JobExecutionContext): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package dev.mongocamp.server.test

import dev.mongocamp.driver.mongodb.GenericObservable
import dev.mongocamp.server.config.DefaultConfigurations
import dev.mongocamp.server.database.{MongoDatabase, TestAdditions}
import dev.mongocamp.server.database.{ MongoDatabase, TestAdditions }
import dev.mongocamp.server.service.ConfigurationRead
import dev.mongocamp.server.test.client.api.AuthApi
import dev.mongocamp.server.test.client.model.{Login, LoginResult}
import dev.mongocamp.server.test.client.model.{ Login, LoginResult }
import io.circe
import sttp.client3.{Identity, RequestT, Response, ResponseException}
import sttp.client3.{ Identity, RequestT, Response, ResponseException }

trait MongoCampBaseServerSuite extends munit.FunSuite {

Expand Down Expand Up @@ -35,7 +35,7 @@ trait MongoCampBaseServerSuite extends munit.FunSuite {
def executeRequest[R <: Any](
request: RequestT[Identity, Either[ResponseException[String, circe.Error], R], Any]
): Response[Either[ResponseException[String, circe.Error], R]] = {
val resultFuture = TestAdditions.backend.send(request)
val resultFuture = TestAdditions.backend.send(request)
resultFuture
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import better.files.File
import com.typesafe.scalalogging.LazyLogging
import de.flapdoodle.embed.mongo.config.Net
import de.flapdoodle.embed.mongo.distribution.Version
import de.flapdoodle.embed.mongo.transitions.{Mongod, RunningMongodProcess}
import de.flapdoodle.embed.mongo.transitions.{ Mongod, RunningMongodProcess }
import de.flapdoodle.embed.mongo.types.DatabaseDir
import de.flapdoodle.embed.process.io.ProcessOutput
import de.flapdoodle.reverse.TransitionWalker
Expand Down Expand Up @@ -49,7 +49,7 @@ object MongoTestServer extends LazyLogging {
if (!running) {
try {
val checkRequest = basicRequest.method(Method.GET, uri"http://localhost:4711").response(asString)
val responseResult = TestAdditions.backend.send(checkRequest).body.getOrElse("not found")
val responseResult = TestAdditions.backend.send(checkRequest).body.getOrElse("not found")
if (responseResult.contains("HTTP on the native driver port.")) {
println("Use local running MongoDb")
System.setProperty("CONNECTION_PORT", "4711")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dev.mongocamp.server.database.TestAdditions
import dev.mongocamp.server.service.ReflectionService
import dev.mongocamp.server.test.client.api.InformationApi

import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.{ ExecutionContext, Future }
import scala.util.Random

object TestServer extends LazyLogging {
Expand All @@ -21,11 +21,12 @@ object TestServer extends LazyLogging {

var retries = 0

lazy val server : RestServer = {
lazy val server: RestServer = {
val servers = ReflectionService.instancesForType(classOf[RestServer])
if (servers.size == 1) {
servers.head
} else {
}
else {
throw new Exception("more than one implementation for rest server found")
}
}
Expand All @@ -41,8 +42,8 @@ object TestServer extends LazyLogging {
}
mongoServerStarted = true
}
val versionRequest = InformationApi().version()
val versionFuture = TestAdditions.backend.send(versionRequest)
val versionRequest = InformationApi().version()
val versionFuture = TestAdditions.backend.send(versionRequest)
versionFuture.body.getOrElse(throw new Exception("error"))
serverRunning = true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.mongocamp.server.test.client.core

import java.net.{URI, URISyntaxException}
import java.net.{ URI, URISyntaxException }

trait AdditionalTypeSerializers {
import io.circe._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.joda.time.DateTime
import org.joda.time.format.ISODateTimeFormat

trait DateSerializers {
import io.circe.{Decoder, Encoder}
import io.circe.{ Decoder, Encoder }
implicit val dateTimeDecoder: Decoder[DateTime] = Decoder.decodeString.map(ISODateTimeFormat.dateOptionalTimeParser().parseDateTime(_))
implicit val dateTimeEncoder: Encoder[DateTime] = Encoder.encodeString.contramap(ISODateTimeFormat.dateTime().print(_))

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "mongocamp-server",
"organization" : "dev.mongocamp",
"version" : "1.5.7",
"version" : "1.5.8.snapshot",
"description" : "",
"directories" : {
"doc" : "docs"
Expand Down

0 comments on commit 507ef97

Please sign in to comment.