Description
The FixtureScripts#runFixtureScript action is marked as "Prototyping", and basically there's no need to invoke it wrapped, but perhaps is relevant for other use cases.
When executing something like:
this.wrap(this.fixtureScripts).runFixtureScript(
new MyFixtureScript(), null);
A NullPointerException is thrown, as for the execution on DomainObjectInvokationHandler#handleActionMethod requires to create an adapter for the contributee (line 590):
[java]
contributeeAdapter = adapterFor(contributed);
[/java]
As the MyFixtureScript is a ViewModel, this will be delegated to FixtureScript#viewModelMemento() which in fact will contain:
[java]
@Programmatic
@Override
public String viewModelMemento()
[/java]
Being "fixtureScripts" null.
Not sure how to solve this, as basically the FixtureScript requires to be injected before executing it.
As perhaps this will be the only method that can potentially been invoked before the FixtureScript being wrapped on the "FixtureScripts" service, an easy solution would be to check if the "fixtureScript" variable is null and, in that case, inject its own instance on this same method.