What's the situation with testing in a Kotlin + Sp...
# server
j
What's the situation with testing in a Kotlin + Spring Boot application? I'm tempted to use TestNG, any reasons not to? Should I use kotlin.test?
d
JUnit5 works like a charm with kotlin test
j
kotlin.test is really only needed for multiplatform
j
not spring boot, but we use TestNG w/ dropwizard extensively
m
I've been testing with kotlintest-runner-junit5 and kotlintest-extensions-spring if I need the Spring context.
👍🏻 1
spring-boot-starter-test also works but I prefer the syntax of io.kotlintest
j
kotlintest != kotlin.test
the former is a horrible name choice
👍 2
m
Yep, I should have mentioned that.
s
We tend to recommand JUnit5 but I guess other solutions are fine too. That said I am not sure TestNG supports test constructor parameter autowiring like Junit5. Also Junit5 will be the default with upcoming Boot 2.2.
s
@jw the naming comes from the fact it was originally inspired by ScalaTest
n
JB should seriously consider renaming kotlin.test to something else (eg Kotlinx Test - not the best example however it is more destinctive than kotlin.test).
👍🏻 2
Many people associate Kotlin Test with this project: https://github.com/kotlintest/kotlintest
j
...ooooooor JB could use the leverage of the foundation and its copyright and trademark on the Kotlin name to force that library to rename
s
I suppose they could, and 200 other projects with Kotlin in the name 😂
n
A much better option is to find out the usage of Kotlin Test and kotlin.test, Whatever library has the least amount of users changes their name to something else. This is a much better solution than having a legal dispute involving copyrights/trademarks that leads to infighting, which nobody wants.
j
One is literally a first-party library and the other third-party. No competition needed because they're not even in the same league.
s
I don't think any name changing needs to happen. One is a popular OSS project and the other is a package name. There's only one person in this thread getting upset by the names.
n
If you look at kotlin.test that is a library (not part of the Kotlin standard library), which is included separately into a Kotlin project just like Kotlin Test. At the end of the day kotlin.test is a third party library with the main difference being that it is developed by JB (Jet Brains).
👍🏻 2
j
Does that make the Kotlin standard library a third party library too? What an insane leap of logic you just made.
s
He literally just said that
kotlin.test
is third party because it's not part of the std lib. I guess it depends whether you consider anything written by jetbrains to be first party regardless of whether you have to include it as a separate dependency. By your logic, Ktor is first party because it's also written by Jetbrains. I think it's a weak argument, but I can see why you might think it.
j
My logic is whether it lives in the Kotlin repo and bears the Kotlin package. Ktor has neither of those so yes it's obviously third party.
Is kotlin-metadata-jvm not first party? It's not the stdlib. What about the Gradle plugins and IDE plugin that are in the Kotlin repo but aren't the stdlib?
Not to mention the stdlib used to depend on a runtime artifact. Was that not first party?
s
What about
kotlinx.serialization
?
j
I don't really care how you classify it and it's irrelevant to the discussion.
s
There is no discussion other than you saying you don't like the name of an OSS project because it has a very similar name to a jetbrains library, both started around the same time in 2015.
j
And one being first party, crucially, being developed in the language repo and versioned and released as part of the language offering. But yeah if you ignore that super tiny detail they're basically the same thing 🙄
s
The names are similar - absolutely. But what's your point here? That KotlinTest should be renamed to KTest or WhartonTest or something? I mean you were suggesting earlier that Jetbrains leverage of the foundation and its copyright and trademark on the Kotlin name to force that library to rename which is absolutely ridiculous.
j
Why is that ridiculous? They've done it before. Trademarks require that you demonstrate a desire to defend them if they are to be upheld. That's like the first thing they teach you about them. So yeah, rename it. You can use my name. Consider this permission.
Also I'm not suggesting JetBrains do anything. I'm suggesting the foundation of which JetBrains is a member do something.
s
Splitting hairs a bit there. Do you suggest the foundation also go through any other project with Kotlin in the name, or just other ones you think cause confusion ? (edited from: any other ones you are confused by)
j
Well since you're resorting to personal attacks I'll say that I hesitated "splitting hairs" since you've demonstrated the inability to understand such distinctions but I'm glad to see that one actually landed. But yeah no confusion here. The one to avoid is immediately obvious. I'm just sad I always have to qualify to people which should be avoided when saying "Kotlin test library"
👎 1
But yeah the foundation should protect their trademark if unaffiliated things claim to be first party and are not. That seems like part of its purpose. An ounce of creativity will land you a better name anyway
s
Now come on Jake. You've come into this thread with suggestions of legal action. Had you come into this thread with a suggestion of a rename, I wouldn't have disagreed with you. Constructive feedback would be taken with grace. Instead you've accused me of personal attacks.
👍 2
I'm very disappointed. I'm always hopeful of suggestions, especially from people of good standing in the community.
j
Lol you clearly implied I couldn't understand the difference which is ironic given that I came into the thread making a distinction between the two for another.
Anyway I'll happily leave you with a suggestion to rename since I didn't start with one: Rename.
1
👋
s
Maybe that's just an English language usage distinction on confused by. I mean as in causing confusion in discussion not that you personally have difficultly telling the difference, but that there's confusion between things. Thank you for your suggestion. Is that a name for the library: rename? That would be funny.
👍 1
n
One suggestion for a new name for Kotlin Test (this one: https://github.com/kotlintest/kotlintest ) is Testy (currently describes the situation of this thread) 😆, which funnily enough is the name of a Go testing library ( https://github.com/xdg-go/testy ). Don't think the suggested name would work unfortunately unless one filters out Go when doing a search.
Here is another name suggestion which hasn't been taken: Konfirm . In a sentence, "When a Kotliner wants to check if the software they develop works they Konfirm it".
😄 1
s
Konfirm is quite good.
n
A new issue has been created in the Kotlin Test issue tracker on renaming the project: https://github.com/kotlintest/kotlintest/issues/948
👍🏻 1