BundleContext bc1 = c.createMock(BundleContext.class);
BundleContext bc2 = c.createMock(BundleContext.class);
ServiceReference sref = c.createMock(ServiceReference.class);
final ClientProxyFactoryBean cpfb = c.createMock(ClientProxyFactoryBean.class);
ReflectionServiceFactoryBean sf = c.createMock(ReflectionServiceFactoryBean.class);
EasyMock.expect(cpfb.getServiceFactory()).andReturn(sf).anyTimes();
PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(bc1, handlerProps) {
@Override
ClientProxyFactoryBean createClientProxyFactoryBean(String frontend) {
return cpfb;
}
@Override
String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
List<AbstractFeature> features, AbstractEndpointFactory factory, Map sd) {
return new String[0];
}
};
Map props = new HashMap();
props.put(RemoteConstants.ENDPOINT_ID, "http://google.de/");
props.put(org.osgi.framework.Constants.OBJECTCLASS, new String[]{"my.class"});
props.put(RemoteConstants.SERVICE_IMPORTED_CONFIGS, new String[]{"my.config"});
EndpointDescription endpoint = new EndpointDescription(props);
cpfb.setAddress((String)EasyMock.eq(props.get(RemoteConstants.ENDPOINT_ID)));
EasyMock.expectLastCall().atLeastOnce();
cpfb.setServiceClass(EasyMock.eq(CharSequence.class));
EasyMock.expectLastCall().atLeastOnce();
c.replay();