1
0
Fork 1
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-01-19 02:48:37 +00:00

Minor changes

This commit is contained in:
carbotaniuman 2021-01-10 20:32:56 -06:00
parent b6c81eeb3c
commit 686e736cf3
5 changed files with 11 additions and 7 deletions

View file

@ -1,4 +1,5 @@
plugins {
id "jacoco"
id "java"
id "org.jetbrains.kotlin.jvm" version "1.4.20"
id "org.jetbrains.kotlin.kapt" version "1.4.0"
@ -26,6 +27,8 @@ dependencies {
compileOnly group: "dev.afanasev", name: "sekret-annotation", version: "0.0.7"
implementation group: "commons-io", name: "commons-io", version: "2.7"
implementation group: "ch.qos.logback", name: "logback-classic", version: "1.3.0-alpha4"
implementation group: "org.http4k", name: "http4k-core", version: "$http_4k_version"
implementation group: "org.http4k", name: "http4k-format-jackson", version: "$http_4k_version"
@ -34,17 +37,16 @@ dependencies {
implementation group: "org.http4k", name: "http4k-server-netty", version: "$http_4k_version"
runtimeOnly group: "io.netty", name: "netty-tcnative-boringssl-static", version: "2.0.34.Final"
implementation group: "ch.qos.logback", name: "logback-classic", version: "1.3.0-alpha4"
implementation group: "com.h2database", name: "h2", version: "1.4.200"
implementation "org.ktorm:ktorm-core:3.2.0"
implementation "org.ktorm:ktorm-jackson:3.2.0"
implementation "org.ktorm:ktorm-core:$ktorm_version"
implementation "org.ktorm:ktorm-jackson:$ktorm_version"
implementation "info.picocli:picocli:4.5.0"
kapt "info.picocli:picocli-codegen:4.5.0"
testImplementation "io.kotest:kotest-runner-junit5:$kotest_version"
testImplementation "io.kotest:kotest-assertions-core:$kotest_version"
}
test {

View file

@ -1,3 +1,4 @@
http_4k_version=3.284.0
exposed_version=0.26.2
kotest_version=4.4.0.RC1
kotest_version=4.4.0.RC1
ktorm_version=3.2.0

View file

@ -143,7 +143,7 @@ class ImageServer(
val image = storage.loadImage(imageId)
if (image != null && image.data.contentType.isImageMimetype()) {
if (image != null) {
request.handleCacheHit(sanitizedUri, image)
} else {
request.handleCacheMiss(sanitizedUri, imageId)

View file

@ -11,6 +11,7 @@ import io.kotest.matchers.longs.shouldBeZero
import io.kotest.matchers.nulls.shouldBeNull
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.shouldBe
import org.apache.commons.io.IOUtils
import org.ktorm.database.Database
import java.lang.IllegalArgumentException
import kotlin.time.ExperimentalTime
@ -85,7 +86,7 @@ class ImageStorageTest : FreeSpec() {
}
"should match content" {
image.stream.readAllBytes().shouldBe(data)
IOUtils.toByteArray(image.stream).shouldBe(data)
}
}