rme = control.createMock(RMEndpoint.class, new Method[] {m});
rme.setAplicationEndpoint(ae);
rme.setManager(manager);
Endpoint e = control.createMock(Endpoint.class);
EasyMock.expect(rme.getEndpoint()).andReturn(e);
EndpointInfo ei = control.createMock(EndpointInfo.class);
EasyMock.expect(e.getEndpointInfo()).andReturn(ei);
Bus bus = control.createMock(Bus.class);
EasyMock.expect(manager.getBus()).andReturn(bus).times(2);
PolicyEngine pe = control.createMock(PolicyEngine.class);
EasyMock.expect(bus.getExtension(PolicyEngine.class)).andReturn(pe);
EasyMock.expect(pe.isEnabled()).andReturn(true);
PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
EasyMock.expect(bus.getExtension(PolicyInterceptorProviderRegistry.class)).andReturn(reg);
EndpointInfo aei = control.createMock(EndpointInfo.class);
EasyMock.expect(ae.getEndpointInfo()).andReturn(aei);
EndpointPolicy epi = control.createMock(EndpointPolicy.class);
EasyMock.expect(pe.getServerEndpointPolicy(aei, null)).andReturn(epi);
EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList<PolicyAssertion>());