I’ve set up some extended properties in my plugin, and I want to unit test they are set.
In my simple mind this should work:
def "project object has antBuilderInput ext property"() {
setup:
def ext = project.ext.antBuilderInput
expect:
ext != null
}
Interestingly the test fails during the setup phase, because its not there.
cannot get property ‘antBuilderInput’ on extra properties extension as it does not exist
groovy.lang.MissingPropertyException: cannot get property ‘antBuilderInput’ on extra properties extension as it does not exist
at org.gradle.api.internal.plugins.DefaultExtraPropertiesExtension.getProperty(DefaultExtraPropertiesExtension.java:56)
at com.lv.plugins.weblogic.WeblogicPluginSpec.project object has antBuilderInput property(WeblogicPluginSpec.groovy:120)
That’s kinda cool that Gradle handles this for me, but I need to assert this before runtime. My question therefore; what’s the best way to test for my antBuilderInput property?
I guess I’m doing the same as, here.