-
-
Notifications
You must be signed in to change notification settings - Fork 234
Groovy
Johan Haleby edited this page Nov 16, 2018
·
8 revisions
Awaitility has a Groovy API that allows you to write
await().until { numberOfReceivedMessages() > 3 }
All you have to do is to depend on the awaitility-groovy-3.1.0 module for this to work (if you're using Groovy 2.2 and above).
Implement the AwaitilityTrait
that is provided in the awaitility-groovy module. Example:
class AwaitilityTraitTest implements AwaitilityTrait {
@Test
def void groovyClosureSupport() {
...
await().until { numberOfReceivedMessages() > 3 }
}
}
Extend or mixin the AwaitilitySupport
class that is provided in the awaitility-groovy module. Example:
@Mixin(AwaitilitySupport)
class AwaitilitySupportTest {
@Test
def void groovyClosureSupport() {
...
await().until { numberOfReceivedMessages() > 3 }
}
}
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility-groovy</artifactId>
<version>${awaitility.version}</version>
</dependency>