expect(resolver.getAddedResources()).andReturn(new Resource[] { });
expect(resolver.getRequiredResources()).andReturn(new Resource[] { resource });
expect(resolver.getOptionalResources()).andReturn(new Resource[] { optionalResource});
expect(resolver.getReason(resource)).andAnswer(new IAnswer<Reason[]>() {
public Reason[] answer() throws Throwable {
return new Reason[] { new ReasonImpl( resource, captureReq.getValue()) };
}
});
expect(resolver.getReason(optionalResource)).andAnswer(new IAnswer<Reason[]>() {
public Reason[] answer() throws Throwable {
return new Reason[] { new ReasonImpl( optionalResource, captureReq.getValue()) };
}
});
expect(resource.getURI()).andReturn("foo:bar");
expect(optionalResource.getURI()).andReturn("foo:optional:baz");
replay(admin, resolver, resource, optionalResource);