ScopeProviderContainer implements IScopeProviderContainer { public IScope getScope(final Object key) throws ScopeProviderException { IScope scope = scopeStorage.get(key); if (null == scope) { throw new ScopeProviderException("Scope not found."); } return scope; } ScopeProviderContainer(final IScopeFactory factory); IScope getScope(final Object key); IScope getCurrentScope(); void addScope(final Object key, final IScope scope); void setCurrentScope(final IScope scope); void deleteScope(final Object key); Object createScope(final Object params); @Override void subscribeOnCreationNewScope(final IAction<IScope> handler); @Override void clearListOfSubscribers();  }
@Test (expected = ScopeProviderException.class) public void checkScopeProviderExceptionByGet() throws Exception { IScopeFactory factory = mock(IScopeFactory.class); IScopeProviderContainer scopeProviderContainer = new ScopeProviderContainer(factory); scopeProviderContainer.getScope("key1"); fail(); }