@Test public void not_found() { ApplicationStatePersistenceStrategy strategy = mockApplicationStatePersistenceStrategy(); Map<String, ApplicationStatePersistenceStrategy> configuration = newMap(); configuration.put("session", strategy); configuration.put("application", strategy); replay(); ApplicationStatePersistenceStrategySource source = new ApplicationStatePersistenceStrategySourceImpl( configuration); try { source.get("aether"); unreachable(); } catch (RuntimeException ex) { assertEquals( ex.getMessage(), "No application state persistence strategy is available with name 'aether'. Available strategies: application, session."); } verify(); }
public ApplicationStatePersistenceStrategy get(String name) { ApplicationStatePersistenceStrategy result = configuration.get(name); if (result == null) throw new RuntimeException(String.format("No application state persistence strategy is available with name '%s'. Available strategies: %s.", name, InternalUtils .joinSorted(configuration.keySet()))); return result; }
ApplicationStatePersistenceStrategySourceImpl implements
        ApplicationStatePersistenceStrategySource { public ApplicationStatePersistenceStrategy get(String name) { ApplicationStatePersistenceStrategy result = configuration.get(name); if (result == null) throw new RuntimeException(String.format("No application state persistence strategy is available with name '%s'. Available strategies: %s.", name, InternalUtils .joinSorted(configuration.keySet()))); return result; } }
ApplicationStatePersistenceStrategySourceImpl implements
        ApplicationStatePersistenceStrategySource { public ApplicationStatePersistenceStrategy get(String name) { ApplicationStatePersistenceStrategy result = configuration.get(name); if (result == null) throw new RuntimeException(String.format("No application state persistence strategy is available with name '%s'. Available strategies: %s.", name, InternalUtils .joinSorted(configuration.keySet()))); return result; } ApplicationStatePersistenceStrategySourceImpl(Map<String, ApplicationStatePersistenceStrategy> configuration); }
ApplicationStatePersistenceStrategySourceImpl implements
        ApplicationStatePersistenceStrategySource { public ApplicationStatePersistenceStrategy get(String name) { ApplicationStatePersistenceStrategy result = configuration.get(name); if (result == null) throw new RuntimeException(String.format("No application state persistence strategy is available with name '%s'. Available strategies: %s.", name, InternalUtils .joinSorted(configuration.keySet()))); return result; } ApplicationStatePersistenceStrategySourceImpl(Map<String, ApplicationStatePersistenceStrategy> configuration); ApplicationStatePersistenceStrategy get(String name); }
ApplicationStatePersistenceStrategySourceImpl implements
        ApplicationStatePersistenceStrategySource { public ApplicationStatePersistenceStrategy get(String name) { ApplicationStatePersistenceStrategy result = configuration.get(name); if (result == null) throw new RuntimeException(String.format("No application state persistence strategy is available with name '%s'. Available strategies: %s.", name, InternalUtils .joinSorted(configuration.keySet()))); return result; } ApplicationStatePersistenceStrategySourceImpl(Map<String, ApplicationStatePersistenceStrategy> configuration); ApplicationStatePersistenceStrategy get(String name);  }