FeatureManagerActor { public void onFeatureStepCompleted(final OnFeatureStepCompletedWrapper wrapper) throws FeatureManagementException { IFeature feature; try { feature = wrapper.getFeature(); checkAndRunConnectedFeatures(); for (IFeature loadedFeature : this.loadedFeatures.values()) { if (null != feature.getDependencies()) { feature.getDependencies().remove(loadedFeature.getName()); } } if (null != feature.getDependencies() && !feature.getDependencies().isEmpty()) { IMessageProcessor mp = wrapper.getMessageProcessor(); mp.pauseProcess(); this.featureProcess.put(mp, feature); } } catch (ReadValueException | AsynchronousOperationException e) { throw new FeatureManagementException(e); } } FeatureManagerActor(); void addFeatures(final AddFeatureWrapper wrapper); void onFeatureLoaded(final OnFeatureLoadedWrapper wrapper); void onFeatureStepCompleted(final OnFeatureStepCompletedWrapper wrapper); void getState(final FeatureManagerStateWrapper wrapper);  }
@Test (expected = FeatureManagementException.class) public void checkFeatureManagementExceptionOnCallOnFeatureStepCompletedMethod() throws Exception { FeatureManagerActor actor = new FeatureManagerActor(); OnFeatureStepCompletedWrapper wrapper = mock(OnFeatureStepCompletedWrapper.class); when(wrapper.getFeature()).thenThrow(ReadValueException.class); actor.onFeatureStepCompleted(wrapper); fail(); }