Skip to content

Instantly share code, notes, and snippets.

@illerax
Created January 5, 2017 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illerax/d8b8536bb61f2dbb20e5b3d0672c54b4 to your computer and use it in GitHub Desktop.
Save illerax/d8b8536bb61f2dbb20e5b3d0672c54b4 to your computer and use it in GitHub Desktop.
package test
import com.illerax.randominit.RandomInit
class RandomInitTest extends GroovyTestCase {
void testRandomInitAnnotation() {
@RandomInit def exp
assert exp == null
@RandomInit Integer int1
assert int1 != null
@RandomInit(min = -10, max = 10) Integer int2
assert int2 >= -10
assert int2 <= 10
@RandomInit(min = -100, max = -50) Integer int3
assert int3 >= -100
assert int3 <= -50
@RandomInit(min = 40, max = 100) BigDecimal dec1
assert dec1 >= 40
assert dec1 <= 100
@RandomInit(min = 1, max = 1) BigDecimal dec2
assert dec2 == 1
@RandomInit(minLength = 3, maxLength = 3) String str1
str1.size() == 3
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment