use of io.joynr.jeeintegration.JoynrIntegrationBean in project joynr by bmwcarit.
the class JeeJoynrServiceLocatorTest method testGetNoProxyAvailable.
@Test(expected = IllegalArgumentException.class)
public void testGetNoProxyAvailable() {
JoynrRuntime joynrRuntime = mock(JoynrRuntime.class);
JoynrIntegrationBean joynrIntegrationBean = mock(JoynrIntegrationBean.class);
when(joynrIntegrationBean.getRuntime()).thenReturn(joynrRuntime);
JeeJoynrServiceLocator subject = new JeeJoynrServiceLocator(joynrIntegrationBean);
subject.get(MyInvalidServiceSync.class, "local");
}
use of io.joynr.jeeintegration.JoynrIntegrationBean in project joynr by bmwcarit.
the class JoynrIntegrationBeanTest method setup.
@Before
public void setup() {
when(joynrRuntimeFactory.getInjector()).thenReturn(Guice.createInjector());
when(joynrRuntimeFactory.create(any())).thenReturn(joynrRuntime);
when(joynrRuntimeFactory.getLocalDomain()).thenReturn(LOCAL_DOMAIN);
doAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
return MyServiceProvider.class;
}
}).when(serviceProviderDiscovery).getProviderInterfaceFor(eq(MyServiceSync.class));
subject = new JoynrIntegrationBean(beanManager, joynrRuntimeFactory, serviceProviderDiscovery);
}
use of io.joynr.jeeintegration.JoynrIntegrationBean in project joynr by bmwcarit.
the class JeeMessagingEndpointTest method createSubject.
private SubjectData createSubject() {
SubjectData result = new SubjectData();
JoynrIntegrationBean joynrIntegrationBean = mock(JoynrIntegrationBean.class);
result.injector = mock(Injector.class);
when(joynrIntegrationBean.getJoynrInjector()).thenReturn(result.injector);
result.objectMapper = mock(ObjectMapper.class);
when(result.injector.getInstance(ObjectMapper.class)).thenReturn(result.objectMapper);
result.messageReceiver = mock(ServletMessageReceiver.class);
when(result.injector.getInstance(ServletMessageReceiver.class)).thenReturn(result.messageReceiver);
result.subject = new JeeMessagingEndpoint(joynrIntegrationBean);
return result;
}
Aggregations