Groovy mock a method with no parameters example
def propertyRefObjectFactory = [
getObjectInstance: {Object objNew, Name nameNew, String suffixValue, Context nameCtx, Hashtable<?, ?> properties ->
testDataSource
}
] as PropertyReferenceObjectFactory