use of io.joynr.capabilities.LocalCapabilitiesDirectoryImpl in project joynr by bmwcarit.
the class LocalDiscoveryTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(localDiscoveryEntryStoreMock.hasDiscoveryEntry(any(DiscoveryEntry.class))).thenReturn(true);
// use default freshnessUpdateIntervalMs: 3600000ms (1h)
final LocalCapabilitiesDirectoryImpl localCapabilitiesDirectory = new LocalCapabilitiesDirectoryImpl(capabilitiesProvisioningMock, globalAddressProviderMock, localDiscoveryEntryStoreMock, globalDiscoveryEntryCacheMock, messageRouterMock, globalCapabilitiesDirectoryClientMock, expiredDiscoveryEntryCacheCleanerMock, 3600000, capabilitiesFreshnessUpdateExecutorMock, defaultDiscoveryRetryIntervalMs, shutdownNotifier);
Module testModule = Modules.override(new CCInProcessRuntimeModule()).with(new TestGlobalAddressModule(), new AbstractModule() {
@Override
protected void configure() {
bind(JoynrMessagingConnectorFactory.class).annotatedWith(Names.named("connectorFactoryMock")).toInstance(joynrMessagingConnectorFactoryMock);
bind(LocalCapabilitiesDirectory.class).toInstance(localCapabilitiesDirectory);
bind(LocalCapabilitiesDirectoryImpl.class).toInstance(localCapabilitiesDirectory);
bind(ProxyInvocationHandlerFactory.class).to(ProxyInvocationHandlerFactoryImpl.class);
}
});
Properties joynrProperties = new Properties();
Injector injector = new JoynrInjectorFactory(new JoynrBaseModule(joynrProperties, testModule)).getInjector();
runtime = injector.getInstance(JoynrRuntime.class);
}
Aggregations