Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin example #1521

Merged
merged 6 commits into from
Jul 15, 2019
Merged

Kotlin example #1521

merged 6 commits into from
Jul 15, 2019

Conversation

eaxdev
Copy link
Contributor

@eaxdev eaxdev commented Jun 2, 2019

Added an example that shows how to use Testcontainers along with the Kotlin language and Spring Boot application. The example uses the GenericContainer and Redis

Copy link
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

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

While I like the idea of having a Kotlin-based example, I would use a different example:

  1. the provided example is too heavy (it uses Kafka which will add 10-20 seconds to our CI)
  2. it does not show how to set properties on containers, which is the biggest problem with Kotlin (see Problems with TestContainers and Kotlin #318)
  3. while it's okay to have Kotlin example, I would keep the Gradle DSL consistent with the rest of the projects here, in Groovy

@eaxdev
Copy link
Contributor Author

eaxdev commented Jun 2, 2019

Hi, @bsideup .

  1. Can I use Redis image as an example? Is it heavy?
  2. Okay, are you suggesting we use this workaround?
  3. Fixed

@bsideup
Copy link
Member

bsideup commented Jun 2, 2019

@eaxdev

  1. yes, Redis is a good candidate.
  2. I would use something like this:
@ClassRule
@JvmField
val redis = object : GenericContainer<Nothing>("redis:3-alpine") {
	init {
		withExposedPorts(6379)
	}
}

(this is pretty aligned with the ideas we have about the next generation of our DSL)

@eaxdev
Copy link
Contributor Author

eaxdev commented Jun 4, 2019

  1. I replaced the Kafka container with Redis
  2. I did it, but through an object companion. That's because @ClassRule wants a static field

@eaxdev
Copy link
Contributor Author

eaxdev commented Jul 14, 2019

Hi, could you review the changes? All review comments have been addressed. Or need something else to fix? Thank!

@bsideup
Copy link
Member

bsideup commented Jul 15, 2019

hi @eaxdev,

I just applied a few changes, should be good to merge after the CI reports green status :)

@bsideup bsideup added this to the next milestone Jul 15, 2019
@bsideup bsideup merged commit 8f1421a into testcontainers:master Jul 15, 2019
@bsideup
Copy link
Member

bsideup commented Jul 15, 2019

@eaxdev merged. Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants