use of io.crnk.client.internal.proxy.ClientProxyFactoryContext in project crnk-framework by crnk-project.
the class CrnkClient method setProxyFactory.
public void setProxyFactory(ClientProxyFactory proxyFactory) {
proxyFactory.init(new ClientProxyFactoryContext() {
@Override
public ModuleRegistry getModuleRegistry() {
return moduleRegistry;
}
@Override
public <T> DefaultResourceList<T> getCollection(Class<T> resourceClass, String url) {
RegistryEntry entry = resourceRegistry.findEntry(resourceClass);
ResourceInformation resourceInformation = entry.getResourceInformation();
final ResourceRepositoryStubImpl<T, ?> repositoryStub = new ResourceRepositoryStubImpl<>(CrnkClient.this, resourceClass, resourceInformation, urlBuilder);
return repositoryStub.findAll(url);
}
});
documentMapper.setProxyFactory(proxyFactory);
}
use of io.crnk.client.internal.proxy.ClientProxyFactoryContext in project crnk-framework by crnk-project.
the class BasicProxyFactoryTest method setup.
@Before
public void setup() {
factory = new BasicProxyFactory();
ClientProxyFactoryContext context = Mockito.mock(ClientProxyFactoryContext.class);
factory.init(context);
}
Aggregations