use of org.apache.cayenne.rop.HttpClientConnection in project cayenne by apache.
the class ClientRuntimeBuilderTest method testClientConnection.
@Test
public void testClientConnection() {
Map<String, String> properties1 = new HashMap<>();
properties1.put(ClientConstants.ROP_SERVICE_URL_PROPERTY, "http://localhost/YuM");
ClientModule module = new ClientModule() {
@Override
public void configure(Binder binder) {
super.configure(binder);
ServerModule.contributeProperties(binder).putAll(properties1);
}
};
Injector injector = DIBootstrap.createInjector(module);
ClientConnection connection = injector.getInstance(ClientConnection.class);
assertNotNull(connection);
assertTrue(connection instanceof HttpClientConnection);
assertSame("Connection must be a singleton", connection, injector.getInstance(ClientConnection.class));
}
Aggregations