add explicit type

This commit is contained in:
xuwei-k
2023-09-10 16:33:18 +09:00
committed by kenji yoshida
parent e441c40429
commit 186269f8ff
6 changed files with 19 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ trait ActivityComponent extends TemplateComponent { self: Profile =>
lazy val Activities = TableQuery[Activities]
class Activities(tag: Tag) extends Table[Activity](tag, "ACTIVITY") with BasicTemplate {
def * = ???
def * : slick.lifted.ProvenShape[Activity] = ???
}
}

View File

@@ -99,26 +99,26 @@ object DatabaseType {
object H2 extends DatabaseType {
val jdbcDriver = "org.h2.Driver"
val slickDriver = BlockingH2Driver
val liquiDriver = new H2Database()
val slickDriver: BlockingJdbcProfile = BlockingH2Driver
val liquiDriver: AbstractJdbcDatabase = new H2Database()
}
object MySQL extends DatabaseType {
val jdbcDriver = "org.mariadb.jdbc.Driver"
val slickDriver = BlockingMySQLDriver
val liquiDriver = new MySQLDatabase()
val slickDriver: BlockingJdbcProfile = BlockingMySQLDriver
val liquiDriver: AbstractJdbcDatabase = new MySQLDatabase()
}
object MariaDb extends DatabaseType {
val jdbcDriver = "org.mariadb.jdbc.Driver"
val slickDriver = BlockingMySQLDriver
val liquiDriver = new MariaDBDatabase()
val slickDriver: BlockingJdbcProfile = BlockingMySQLDriver
val liquiDriver: AbstractJdbcDatabase = new MariaDBDatabase()
}
object PostgreSQL extends DatabaseType {
val jdbcDriver = "org.postgresql.Driver2"
val slickDriver = BlockingPostgresDriver
val liquiDriver = new PostgresDatabase()
val slickDriver: BlockingJdbcProfile = BlockingPostgresDriver
val liquiDriver: AbstractJdbcDatabase = new PostgresDatabase()
}
object BlockingPostgresDriver extends slick.jdbc.PostgresProfile with BlockingJdbcProfile {

View File

@@ -24,15 +24,16 @@ class GitBucketCoreModuleSpec extends AnyFunSuite {
)
}
implicit private val suiteDescription = Description.createSuiteDescription(getClass)
implicit private val suiteDescription: Description = Description.createSuiteDescription(getClass)
Seq("8.0", "5.7").foreach { tag =>
test(s"Migration MySQL $tag", ExternalDBTest) {
val container = new MySQLContainer() {
override val container = new org.testcontainers.containers.MySQLContainer(s"mysql:$tag") {
override def getDriverClassName = "org.mariadb.jdbc.Driver"
override def getJdbcUrl: String = super.getJdbcUrl + "?permitMysqlScheme"
}
override val container: org.testcontainers.containers.MySQLContainer[_] =
new org.testcontainers.containers.MySQLContainer(s"mysql:$tag") {
override def getDriverClassName = "org.mariadb.jdbc.Driver"
override def getJdbcUrl: String = super.getJdbcUrl + "?permitMysqlScheme"
}
// TODO https://jira.mariadb.org/browse/CONJ-663
container.withCommand("mysqld --default-authentication-plugin=mysql_native_password")
}

View File

@@ -13,7 +13,7 @@ import org.eclipse.jgit.lib.ObjectId
object ApiSpecModels {
implicit val context = JsonFormat.Context("http://gitbucket.exmple.com", None)
implicit val context: JsonFormat.Context = JsonFormat.Context("http://gitbucket.exmple.com", None)
val date1 = {
val d = Calendar.getInstance(TimeZone.getTimeZone("UTC"))

View File

@@ -1,11 +1,12 @@
package gitbucket.core.api
import org.json4s.Formats
import org.json4s.jackson.JsonMethods
import org.scalatest.funsuite.AnyFunSuite
class JsonFormatSpec extends AnyFunSuite {
import ApiSpecModels._
implicit val format = JsonFormat.jsonFormats
implicit val format: Formats = JsonFormat.jsonFormats
private def expected(json: String) = json.replaceAll("\n", "")
def normalizeJson(json: String) = {

View File

@@ -9,7 +9,7 @@ import org.mockito.Mockito._
class HelpersSpec extends AnyFunSpec {
private implicit val context = mock(classOf[Context])
private implicit val context: Context = mock(classOf[Context])
private val repository = mock(classOf[RepositoryInfo])
import helpers._