MessageProcessingSequence implements IMessageProcessingSequence, IDumpable { @Override public int getStepAtLevel(final int level) throws InvalidArgumentException { if (level < 0 || level > stackIndex) { throw new InvalidArgumentException("Level index is out of range."); } return stepStack[level]; } MessageProcessingSequence(final int stackDepth, final IReceiverChain mainChain); @Override void reset(); @Override boolean next(); @Override void goTo(final int level, final int step); @Override void end(); @Override int getCurrentLevel(); @Override int getStepAtLevel(final int level); @Override IMessageReceiver getCurrentReceiver(); @Override IObject getCurrentReceiverArguments(); @Override void callChain(final IReceiverChain chain); @Override void catchException(final Throwable exception, final IObject context); @Override IObject dump(final IObject options);  }
@Test(expected = InvalidArgumentException.class) public void Should_getStepAtLevelThrow_When_LevelIndexIsNegative() throws Exception { new MessageProcessingSequence(5, mainChainMock).getStepAtLevel(-1); }
@Test(expected = InvalidArgumentException.class) public void Should_getStepAtLevelThrow_When_LevelIndexIsGreaterThanIndexOfCurrentLevel() throws Exception { new MessageProcessingSequence(5, mainChainMock).getStepAtLevel(1); }