ScopeProviderContainer implements IScopeProviderContainer { public void deleteScope(final Object key) throws ScopeProviderException { try { scopeStorage.remove(key); } catch (Exception e) { throw new ScopeProviderException("Error was occurred", e); } } 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 checkScopeProviderExceptionByDelete() throws Exception { IScopeFactory factory = mock(IScopeFactory.class); IScopeProviderContainer scopeProviderContainer = new ScopeProviderContainer(factory); scopeProviderContainer.deleteScope(null); fail(); }