Search in sources :

Example 1 with RouterFactory

use of io.scalecube.services.routing.RouterFactory in project scalecube by scalecube.

the class RoutersTest method test_router_factory.

@Test
public void test_router_factory() {
    RouterFactory factory = new RouterFactory(null);
    Router router = factory.getRouter(RandomServiceRouter.class);
    assertTrue(router != null);
    // dummy router will always throw exception thus cannot be created.
    Router dummy = factory.getRouter(DummyRouter.class);
    assertTrue(dummy == null);
}
Also used : RouterFactory(io.scalecube.services.routing.RouterFactory) RandomServiceRouter(io.scalecube.services.routing.RandomServiceRouter) Router(io.scalecube.services.routing.Router) Test(org.junit.Test) BaseTest(io.scalecube.testlib.BaseTest)

Aggregations

RandomServiceRouter (io.scalecube.services.routing.RandomServiceRouter)1 Router (io.scalecube.services.routing.Router)1 RouterFactory (io.scalecube.services.routing.RouterFactory)1 BaseTest (io.scalecube.testlib.BaseTest)1 Test (org.junit.Test)1