Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Add spring-boot sample application #746

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ramsrib
Copy link

@ramsrib ramsrib commented Mar 9, 2018

Context

Added spring-boot sample which is missing in the present kotlin-dsl samples.

Contributor Checklist

  • Base the PR against the develop branch
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Provide integration tests to verify changes from a user perspective
  • Provide unit tests to verify logic
  • Ensure that tests pass locally: ./gradlew check --parallel


@Test
fun hello() {
Assertions.assertEquals("Hello, Spring Boot!..", restTemplate.getForObject<String>("/hello"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭕ Static import of Assertions.assertEquals probably better.

}
}

(tasks.findByName("test") as Test).useJUnitPlatform()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally I find

tasks.withType(Test::class.java) {
    useJUnitPlatform()
}

more idiomatic

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@breskeby
This is simpler:

tasks.withType<Test> {
    useJUnitPlatform()
}

But this is bikeshedding. The way it is here also makes sense.

@ramsrib
Copy link
Author

ramsrib commented Mar 12, 2018

Build is failing in JDK 8. Any idea?


org.gradle.kotlin.dsl.integration.KotlinBuildScriptModelIntegrationTest > can fetch buildSrc classpath in face of compilation errors STANDARD_ERROR
    e: /tmp/junit638243372634683066/can#20fetch#20buildSrc#20classpath#20in#20face#20of#20compilation#20errors/build.gradle.kts:2:20: Expecting an expression
    org.gradle.internal.exceptions.LocationAwareException: Build file '/tmp/junit638243372634683066/can#20fetch#20buildSrc#20classpath#20in#20face#20of#20compilation#20errors/build.gradle.kts' line: 2
    Script compilation error:
      Line 2:             val p =
                                 ^ Expecting an expression
    1 error
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler.withKotlinCompiler(KotlinBuildScriptCompiler.kt:508)

@ramsrib ramsrib force-pushed the develop branch 3 times, most recently from 5a076eb to ef63e06 Compare April 30, 2018 20:54
@JLLeitschuh
Copy link
Contributor

@ramsrib Is that a test failure?

@ramsrib
Copy link
Author

ramsrib commented May 3, 2018

It doesn't look like a test failure.

Signed-off-by: Sriram <sri.kmb@gmail.com>
Signed-off-by: Sriram <sri.kmb@gmail.com>
@ramsrib
Copy link
Author

ramsrib commented May 15, 2018

Guys, Any idea on why the build is failing?

@eskatos eskatos changed the base branch from develop to master April 25, 2019 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants