Skip to content

Commit

Permalink
Towards #16 drop info logging during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
binkley committed Dec 19, 2016
1 parent c94f4de commit 5480ed6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<environmentVariables>
<SPRING_PROFILES_ACTIVE>test</SPRING_PROFILES_ACTIVE>
</environmentVariables>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
Expand All @@ -254,6 +259,11 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<environmentVariables>
<SPRING_PROFILES_ACTIVE>test</SPRING_PROFILES_ACTIVE>
</environmentVariables>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/hm/binkley/labs/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod.GET
import org.springframework.web.bind.annotation.RestController


val logger = getLogger(Application::class.java)!!

@EnableHystrixDashboard
@SpringBootApplication
@RestController
open class Application : ApplicationListener<EmbeddedServletContainerInitializedEvent> {
@RequestMapping("/", method = arrayOf(GET))
fun home(): String = "Hello, world!\n"

open class Application
: ApplicationListener<EmbeddedServletContainerInitializedEvent> {
override fun onApplicationEvent(
event: EmbeddedServletContainerInitializedEvent) = logger.info(
"Ready on port ${event.embeddedServletContainer.port}")

@RequestMapping("/", method = arrayOf(GET))
fun home(): String = "Hello, world!\n"
}

fun main(args: Array<String>) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ spring:
output:
ansi:
enabled: always # Lie because Spring does not grok Cygwin

---

spring:
profiles: test

logging:
level:
root: WARN
hm.binkley.labs.Application: WARN

0 comments on commit 5480ed6

Please sign in to comment.