Is there an equivalent for the following JUnit?
@RunWith(SpringJUnit4ClassRunner::class)
@ContextConfiguration(classes = arrayOf(Application::class), loader = SpringApplicationContextLoader::class)
@WebIntegrationTest
+1 for this issue.
Maybe there is some lessons that could be learned from:
https://github.com/dam5s/kspec/tree/master/libraries/kspec-spring
Any updates on this?
No plans yet, going to push 1.0 first before dealing with this.
We can revisit this after the 1.0 release.
+1 here guys.
Please let us (the Spring Boot team) know if there's anything we can do to help
I have implemented a runner for my own library (Aspen) that uses the SpringContextManager. It's actually pretty simple to get a runner working, the Spring team has done a great job at abstracting the way to run tests using Spring.
You can find the runner I implemented there: https://github.com/dam5s/aspen/blob/master/libraries/aspen-spring/src/main/kotlin/io/damo/aspen/spring/SpringTestTreeRunner.kt
@wilkinsona @dam5s Thanks Andy, Damien. We really would like to get 1.0 out the door with as much as the planned functionality and there's still quite a bit to do. As soon as that happens I think we can pick this up and start work on it.
So, we have 1.0 out. Any plans for Spring Integration once you have the Spek API stabilized?
Not a Spring user: please don't include Spring support to the core
(separate lib will be better), thanks.
On 4 Sep 2016 1:07 pm, "Rafal Glowinski" [email protected] wrote:
So, we have 1.0 out. Any plans for Spring Integration once you have the
Spek API stabilized?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JetBrains/spek/issues/50#issuecomment-244596872, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7B3Bw2G6-rFIwFph16YqYr66BDhfiXks5qmqZ6gaJpZM4GjsEO
.
@artem-zinnatullin We won't be doing that.
@rafal-glowinski We'll get to this.
I'm still working on a spec for extension which can be found here (#115), feedback is very much welcomed.
Any progress on this?
hey guys, v1.1.0-beta3 is out with extension support. Will create a proof of concept sometime next week, so stay tuned.
Hey guys, been looking into Spring's TestContext framework which is the backbone of its integration testing support. It makes certain assumptions on how tests, specifically tests are defined as class methods. We can have a workaround for bootstrapping spring's ApplicationContext, but for certain features it will be hard and maybe impossible to support (transactions, @IfProfileValue, @Timed, @Repeat, ...). Anyway, I'll update this ticket once I have more progress.
Here's the POC https://github.com/spekframework/spek-spring-extension. It's very hackish, but it will be a good starting point.
I'm closing this issue, feel free to file feature requests on that repo.
@raniejade Please create an issue on https://jira.spring.io/browse/SPR/ with more details about what changes you would need in TestContext to make it more Spek friendly, I will try to see if something can be done for Spring Framework 5.0 RELEASE.
thanks @sdeleuze! I'll find sometime later today :+1:
@sdeleuze https://jira.spring.io/browse/SPR-15143 :)
@wilkinsona or @sdeleuze: any word on https://jira.spring.io/browse/SPR-15143? It's been
"waiting for triage" for more than a year. Without the ability to integrate with spring's context, our adoption of Spek is hamstrung.
@bondpp7 Sorry, I can't help you there. Some input from @sbrannen is needed.
Hi everybody,
I don't foresee any easy way to support testing frameworks based on lambda expressions or closures with the _Spring TestContext Framework_, simply because the two programming models are completely different with regard to registration (and more importantly _lookup_) of metadata as well as test execution lifecycle.
I'll post something similar on the related JIRA issue for Spring and will seek feedback there.
Regards,
Sam
hi guys, I'm looking for the function used in the sample but seems like the sample is based on spek version 1.1.0-beta3 and the current version is 2.0.10, a lot of things has changed there.
@jffiorillo I think you can still salvage the POC and re-use it (with some modifications) in Spek 2.x. LifecycleListener is still present in 2.x.
@raniejade thank you for you answer but I found the following issues when attempting to migrate your example to spek2:
fun Spec.createContext(spec: KClass<*>): SpringContext {
return SpringContext(TestContextManager(spec.java), this@createContext).apply {
registerListener(this)
}
}
I'm guessing that I need to somehow use the root to solve this issue? but I'm not sure 🤔
spec is used to get a SpecBody and use the function memoized to inject the values from testContext.applicationContext.getBean(T::class.java) but a Spek is not a SpecBody anymore.inline fun <reified T: Any> inject(): LifecycleAware<T> {
return spec.memoized {
testContext.applicationContext.getBean(T::class.java)
}
}
I guess that I need to somehow use the LifecycleAware#memoized but I'm not sure.
Can you give me some hints about how to solve those issues? Thank you
Root could work, or just use GroupBody which Root inherits from. Also a hint, GroupBody implements LifecycleAware :)
Most helpful comment
@sdeleuze https://jira.spring.io/browse/SPR-15143 :)