ScopeProviderContainer implements IScopeProviderContainer { @Override public void subscribeOnCreationNewScope(final IAction<IScope> handler) throws ScopeProviderException { if (null == handler) { throw new ScopeProviderException("Incoming argument should not be null"); } handlerStorage.add(handler); } 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 checkScopeProviderExceptionOnSubscribeOnCreationNewScope() throws Exception { IScopeFactory factory = mock(IScopeFactory.class); IScopeProviderContainer scopeProviderContainer = new ScopeProviderContainer(factory); scopeProviderContainer.subscribeOnCreationNewScope(null); }