OrientRoutingRuleStore extends StateGuardLifecycleSupport implements RoutingRuleStore { @Override public RoutingRule getByName(final String name) { checkNotNull(name); return inTx(databaseInstance).call(db -> entityAdapter.read(db, name)); } @Inject  OrientRoutingRuleStore(@Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
                                final OrientRoutingRuleEntityAdapter entityAdapter); @Override @Guarded(by = STARTED) RoutingRule create(final RoutingRule rule); @Override @Guarded(by = STARTED) void update(final RoutingRule rule); @Override @Guarded(by = STARTED) List<RoutingRule> list(); @Override void delete(final RoutingRule rule); @Override RoutingRule getByName(final String name); @Override RoutingRule getById(final String id); @Override RoutingRule newRoutingRule();  }
@Test public void testGetByName() throws Exception { underTest.start(); createRoutingRule("foo", "foo"); createRoutingRule("bar", "bar"); RoutingRule rule = underTest.getByName("foo"); assertThat(rule.name(), is("foo")); }