Support for Spock
See original GitHub issueIt would be great to have a support for Spock. So one could use the library like this:
import dev.morling.jfrunit.*
import spock.lang.Specification
import java.time.Duration
import static dev.morling.jfrunit.JfrEventsAssert.*
import static dev.morling.jfrunit.ExpectedEvent.*
@JfrEventTest
class JfrSpec extends Specification {
JfrEvents jfrEvents = new JfrEvents()
@EnableEvent('jdk.GarbageCollection')
@EnableEvent('jdk.ThreadSleep')
def 'should Have GC And Sleep Events'() throws Exception {
when:
System.gc()
sleep(1000)
then:
assertThat(jfrEvents).contains(event('jdk.GarbageCollection'))
assertThat(jfrEvents).contains(
event('jdk.ThreadSleep').with('time', Duration.ofSeconds(1)))
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Spock
Spock is a testing and specification framework for Java and Groovy applications. What makes it stand out from the crowd is its beautiful...
Read more >Introduction to Testing with Spock and Groovy - Baeldung
A quick and practical guide to testing with Spock and Groovy. ... As we can see, blocks help our test become more readable....
Read more >Spock Tutorial: Testing With Spock Framework and Groovy
This introductory tutorial will explain all about Spock, which is a test framework that's built on top of Groovy. It enforces BDD at...
Read more >Getting started with Spock | IntelliJ IDEA Documentation
Spock is a testing framework for Java and Groovy code that you can use to automate your tests. IntelliJ IDEA supports full Spock...
Read more >spockframework/spock: The Enterprise-ready testing ... - GitHub
Spock is a BDD-style developer testing and specification framework for Java and Groovy applications.To learn more about Spock, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I might have a PR soon 😃
Interesting idea, I certainly could see us doing that. What’s the language used above, Groovy?