Search in sources :

Example 1 with ReactiveStreamsTestService

use of org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService in project camel by apache.

the class CamelReactiveStreamsTest method testSameServiceReturnedFromRegistry.

@Test
public void testSameServiceReturnedFromRegistry() {
    CamelReactiveStreamsService service1 = CamelReactiveStreams.get(context);
    CamelReactiveStreamsService service2 = CamelReactiveStreams.get(context);
    assertEquals(service1, service2);
    assertTrue(service1 instanceof ReactiveStreamsTestService);
    assertEquals("from-registry", ((ReactiveStreamsTestService) service1).getName());
}
Also used : ReactiveStreamsTestService(org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService) CamelReactiveStreamsService(org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService) Test(org.junit.Test)

Example 2 with ReactiveStreamsTestService

use of org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService in project camel by apache.

the class CamelReactiveStreamsTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry registry = super.createRegistry();
    registry.bind("dummy", new ReactiveStreamsTestService("from-registry"));
    return registry;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) ReactiveStreamsTestService(org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService)

Example 3 with ReactiveStreamsTestService

use of org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService in project camel by apache.

the class CamelReactiveStreamsTest method testNamedServiceResolvedUsingFactory.

@Test
public void testNamedServiceResolvedUsingFactory() {
    CamelReactiveStreamsService service1 = CamelReactiveStreams.get(context, "test-service");
    assertTrue(service1 instanceof ReactiveStreamsTestService);
    assertNull(((ReactiveStreamsTestService) service1).getName());
}
Also used : ReactiveStreamsTestService(org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService) CamelReactiveStreamsService(org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService) Test(org.junit.Test)

Example 4 with ReactiveStreamsTestService

use of org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService in project camel by apache.

the class CamelReactiveStreamsTest method testSameNamedServiceReturnedFromRegistry.

@Test
public void testSameNamedServiceReturnedFromRegistry() {
    CamelReactiveStreamsService service1 = CamelReactiveStreams.get(context, "dummy");
    CamelReactiveStreamsService service2 = CamelReactiveStreams.get(context, "dummy");
    assertEquals(service1, service2);
    assertTrue(service1 instanceof ReactiveStreamsTestService);
    assertEquals("from-registry", ((ReactiveStreamsTestService) service1).getName());
}
Also used : ReactiveStreamsTestService(org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService) CamelReactiveStreamsService(org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService) Test(org.junit.Test)

Aggregations

ReactiveStreamsTestService (org.apache.camel.component.reactive.streams.support.ReactiveStreamsTestService)4 CamelReactiveStreamsService (org.apache.camel.component.reactive.streams.api.CamelReactiveStreamsService)3 Test (org.junit.Test)3 JndiRegistry (org.apache.camel.impl.JndiRegistry)1