Clean gradle build
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user