@Test
public void cellRoutingRulesFromConfig() {

    TitusFederationConfiguration titusFederationConfiguration = mock(TitusFederationConfiguration.class);
    when(titusFederationConfiguration.getCells()).thenReturn("cell1=hostName1:7001;cell2=hostName2:7002");
    when(titusFederationConfiguration.getRoutingRules()).thenReturn("cell1=(app1.*|app2.*);cell2=(app3.*)");
    CellInfoResolver cellInfoResolver = new DefaultCellInfoResolver(titusFederationConfiguration);
    ApplicationCellRouter cellRouter = new ApplicationCellRouter(cellInfoResolver, titusFederationConfiguration);
    assertThat(cellRouter.routeKey(APP_3).get().getName()).isEqualTo("cell2");
    assertThat(cellRouter.routeKey(APP_2).get().getName()).isEqualTo("cell1");
    // if not rules, by default go to the first configured in titus.federation.cells
    assertThat(cellRouter.routeKey(OTHER).get().getName()).isEqualTo("cell1");
}