Skip to content

Instantly share code, notes, and snippets.

@curtisallen
Created October 29, 2014 17:31
Show Gist options
  • Save curtisallen/ac68029c4f8d328b0632 to your computer and use it in GitHub Desktop.
Save curtisallen/ac68029c4f8d328b0632 to your computer and use it in GitHub Desktop.
class DefaultUtilsSpecTest extends Specification {
@Unroll
def "test defaults (#a #b #c) = #d"(String a, String b, String c, String d){
expect:
DefaultUtils.defaultIfNull(a, b, c) == d
where:
a | b | c | d
"val1" | null | "default" | "val1"
null | "val2"| "default" | "val2"
null | null | "default" | "default"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment