RouteContext { public Optional<RouteMapper> findTableMapper(final String logicDataSourceName, final String actualTableName) { for (RouteUnit each : routeUnits) { Optional<RouteMapper> result = each.findTableMapper(logicDataSourceName, actualTableName); if (result.isPresent()) { return result; } } return Optional.empty(); }  boolean isSingleRouting(); Collection<String> getActualDataSourceNames(); List<Set<String>> getActualTableNameGroups(final String actualDataSourceName, final Set<String> logicTableNames); Map<String, Set<String>> getDataSourceLogicTablesMap(final Collection<String> actualDataSourceNames); Optional<RouteMapper> findTableMapper(final String logicDataSourceName, final String actualTableName);  }
@Test public void assertFindTableMapper() { Optional<RouteMapper> actual = multiRouteContext.findTableMapper(DATASOURCE_NAME_1, ACTUAL_TABLE); assertTrue(actual.isPresent()); assertThat(actual.get(), is(new RouteMapper(LOGIC_TABLE, ACTUAL_TABLE))); }
@Test public void assertTableMapperNotFound() { assertFalse(singleRouteContext.findTableMapper(DATASOURCE_NAME_1, ACTUAL_TABLE).isPresent()); }