Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Aug 31, 2017
1 parent 1cf6b11 commit 5922d60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
16 changes: 7 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
buildscript {
val springBootVersion = "1.5.4.RELEASE"
val kotlinVersion = "1.1.3"

repositories {
mavenCentral()
}
}

dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("org.jetbrains.kotlin:kotlin-noarg:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
plugins {
val kotlinVersion = "1.1.4-3"
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion
id("org.jetbrains.kotlin.plugin.noarg") version kotlinVersion
id ("org.springframework.boot") version "1.5.6.RELEASE"
}

apply {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/hello/CustomerController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RestController

@RestController
class CustomerController(val repository:CustomerRepository) {
class CustomerController(private val repository: CustomerRepository) {

@GetMapping("/")
fun findAll() = repository.findAll()
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/hello/ApplicationTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ApplicationTests {
@Test
fun findAll() {
val content = """[{"firstName":"Jack","lastName":"Bauer","id":1},{"firstName":"Chloe","lastName":"O'Brian","id":2},{"firstName":"Kim","lastName":"Bauer","id":3},{"firstName":"David","lastName":"Palmer","id":4},{"firstName":"Michelle","lastName":"Dessler","id":5}]"""
assertEquals(content, restTemplate.getForEntity("/", String::class.java).body)
assertEquals(content, restTemplate.getForEntity("/", String::class.java).body) // See https://github.com/spring-projects/spring-boot/issues/8062
}

}

0 comments on commit 5922d60

Please sign in to comment.