icfnext / prosper

A Spock-based integration testing library for prosperous AEM development.
Other
28 stars 19 forks source link

Unable to apply mixins using NodeBuilder #10

Closed antonyh closed 7 years ago

antonyh commented 8 years ago

I've tried to put mixins on a node using the NodeBuilder, but

javax.jcr.nodetype.ConstraintViolationException: No matching property definition: jcr:primaryType = sling:Folder

I've tried

"jcr:mixinTypes": ["mix:language"]
"jcr:mixinTypes": "[mix:language]"
"jcr:mixinTypes": "mix:language"

None of which work. I should be able to apply a mixin to a Sling Folder node, but it's just won't permit this. Is there a special way to apply mixins, or is this a shortcoming of Prosper?

markdaugherty commented 7 years ago

You should be able to add mixins using the JCR API directly.

def setupSpec() {
    getNode("/folder").addMixin("mix:language")
    session.save()
}
antonyh commented 7 years ago

Thanks, I'll give this a go.