clean warnings
This commit is contained in:
@@ -36,7 +36,7 @@ plugins {
|
||||
|
||||
id("com.github.johnrengelman.shadow") version "5.2.0"
|
||||
id("org.jlleitschuh.gradle.ktlint") version "9.4.1"
|
||||
id("org.owasp.dependencycheck") version "6.0.5"
|
||||
id("org.owasp.dependencycheck") version "6.1.1"
|
||||
id("org.sonarqube") version "3.1.1"
|
||||
id("net.nemerosa.versioning") version "2.14.0"
|
||||
id("io.gitlab.arturbosch.detekt") version "1.16.0-RC1"
|
||||
|
||||
@@ -53,7 +53,6 @@ import io.ktor.features.ContentNegotiation
|
||||
import io.ktor.features.DataConversion
|
||||
import io.ktor.features.NotFoundException
|
||||
import io.ktor.features.StatusPages
|
||||
import io.ktor.features.maxAge
|
||||
import io.ktor.http.HttpHeaders
|
||||
import io.ktor.http.HttpMethod
|
||||
import io.ktor.http.HttpStatusCode
|
||||
@@ -205,7 +204,7 @@ fun Application.module(env: Env = PROD) {
|
||||
}
|
||||
allowCredentials = true
|
||||
allowSameOrigin = true
|
||||
maxAge = Duration.ofDays(1)
|
||||
maxAgeInSeconds = Duration.ofDays(1).seconds
|
||||
}
|
||||
|
||||
if (env == PROD) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package fr.dcproject.application
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature
|
||||
import com.fasterxml.jackson.databind.ObjectMapper
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies
|
||||
import com.fasterxml.jackson.databind.SerializationFeature
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule
|
||||
import com.fasterxml.jackson.datatype.joda.JodaModule
|
||||
@@ -68,7 +68,7 @@ val KoinModule = module {
|
||||
single<ObjectMapper> {
|
||||
jacksonObjectMapper().apply {
|
||||
registerModule(SimpleModule())
|
||||
propertyNamingStrategy = PropertyNamingStrategy.SNAKE_CASE
|
||||
propertyNamingStrategy = PropertyNamingStrategies.LOWER_CAMEL_CASE
|
||||
|
||||
registerModule(JodaModule())
|
||||
disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||
|
||||
@@ -94,7 +94,7 @@ class NotificationConsumer(
|
||||
|
||||
private suspend fun followersFromMessage(body: ByteArray, action: suspend (DecodedMessage) -> Unit) {
|
||||
val rawMessage: String = body.toString(Charsets.UTF_8)
|
||||
val notification: EntityNotification = Notification.fromString<EntityNotification>(rawMessage) ?: error("Unable to deserialize notification message from rabbit")
|
||||
val notification: EntityNotification = Notification.fromString(rawMessage)
|
||||
val follows = when (notification.type) {
|
||||
"article" -> followArticleRepo.findFollowsByTarget(notification.target)
|
||||
"constitution" -> followConstitutionRepo.findFollowsByTarget(notification.target)
|
||||
|
||||
@@ -114,9 +114,9 @@ class NotificationConsumerTest {
|
||||
).await()
|
||||
|
||||
/* Check if notifications sent */
|
||||
verify(timeout = 1000) { followArticleRepo.findFollowsByTarget(any()) }
|
||||
verify(timeout = 1000) { emailSender.sendEmail(any()) }
|
||||
verify(timeout = 1000) { asyncCommand.zadd(any<String>(), any<Double>(), any<String>()) }
|
||||
verify(timeout = 2000) { followArticleRepo.findFollowsByTarget(any()) }
|
||||
verify(timeout = 2000) { emailSender.sendEmail(any()) }
|
||||
verify(timeout = 2000) { asyncCommand.zadd(any<String>(), any<Double>(), any<String>()) }
|
||||
|
||||
consumer.close()
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ fun createCommentOnTarget(
|
||||
content: String? = null
|
||||
) {
|
||||
val commentRepository: CommentRepository by lazy { GlobalContext.get().koin.get() }
|
||||
val createdBy = createCitizen(createdBy)
|
||||
val creator = createCitizen(createdBy)
|
||||
val comment = CommentForUpdate(
|
||||
id = id ?: UUID.randomUUID(),
|
||||
createdBy = createdBy,
|
||||
createdBy = creator,
|
||||
target = target,
|
||||
content = content ?: LoremIpsum().getParagraphs(1, 3)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user