Clean gradle build

This commit is contained in:
2020-11-29 21:15:31 +01:00
parent 90701dcdce
commit 909fb482a8
31 changed files with 337 additions and 152 deletions
+7 -3
View File
@@ -1,11 +1,15 @@
import be.simplenotes.Libs
import be.simplenotes.micronaut
plugins {
id("be.simplenotes.base")
kotlin("kapt")
id("be.simplenotes.micronaut")
}
dependencies {
implementation(Libs.micronaut)
kapt(Libs.micronautProcessor)
micronaut()
testImplementation(Libs.Test.junit)
testImplementation(Libs.Test.assertJ)
testRuntimeOnly(Libs.Slf4J.logback)
}
+29
View File
@@ -0,0 +1,29 @@
package be.simplenotes.config
import io.micronaut.context.ApplicationContext
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
class ConfigTest {
private val ctx = ApplicationContext.run()
@Test
fun `check application yaml is on the classpath`() {
val yaml = javaClass.getResource("/application.yaml")
assertThat(yaml).`as`("The application.yaml resource").isNotNull
assertThat(yaml.readText()).`as`("The config content").isNotBlank
}
@Test
fun `check config properties`() {
assertThat(ctx.getProperty("jwt.validity", Int::class.java))
.`as`("Jwt.validity")
.isPresent
}
@Test
fun `load jwt config`() {
val jwtConfig = ctx.getBean(JwtConfig::class.java)
assertThat(jwtConfig).isNotNull
}
}
+14
View File
@@ -0,0 +1,14 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<withJansi>true</withJansi>
<encoder>
<pattern>%cyan(%d{YYYY-MM-dd HH:mm:ss.SSS}) [%thread] %highlight(%-5level) %green(%logger{36}) - %msg%n
</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>
<logger name="io.micronaut" level="TRACE"/>
<logger name="io.micronaut.context.lifecycle" level="TRACE"/>
</configuration>