ContextInternals.setMarinerPageContext(requestContext, pageContext);
requestContext.expects.getMarinerPageContext().returns(pageContext);
pageContext.expects.getCurrentElement().returns(formElement);
formElement.expects.getProtocolAttributes().returns(formAttributes).max(2);
formElement.expects.getFormDescriptor().returns(fd).any();
PolicyReferenceResolverMock policyResolver = PolicyReferenceResolverTestHelper.
getCommonExpectations(expectations, mockFactory);
pageContext.expects.getPolicyReferenceResolver().returns(policyResolver);
fd.fuzzy.addField(mockFactory.expectsInstanceOf(FieldDescriptor.class));
// Run the test.