IntelligentDoSLibraryImpl implements IntelligentDoSLibrary { @Override public synchronized AttackModel nextAttack() { hasFurtherAttack = false; return currentAttack; } IntelligentDoSLibraryImpl( String xmlMessage, PositionIterator positionIterator ); @Override void initialize(); static DoSAttack[] getAllAttacks(); @Override void setAttacks( DoSAttack[] attacks ); void setSuccessDecider( SuccessDecider successDecider ); void setCommonParams( List<CommonParamItem> commonParamList ); void setServerRecoveryTime( int timeInMillies ); @Override boolean hasFurtherAttack(); @Override synchronized AttackModel nextAttack(); @Override synchronized void update( AttackModel attackModel ); @Override void updateTestProbes( Metric metric ); @Override List<SuccessfulAttack> getSuccessfulAttacks(); @Override List<DoSAttack> getNotPossible(); @Override List<Threshold> getThresholds(); @Override boolean wasSuccessful(); @Override String getTestProbeContent(); Long[] getCurrentUntampered(); @Override double getMaximumRequestsPerSecond(); static IDoSBuilder create(); static final int DEFAULT_SERVER_RECOVERY; static final List<CommonParamItem> COMMONPARAMS; }
@Test public void attackModel() { AttackModel attackModel = impl.nextAttack(); assertThat( attackModel, notNullValue() ); }
@Test public void untamperedAttackContent() { AttackModel attack = impl.nextAttack(); assertThat( attack.getRequestType(), is( RequestType.UNTAMPERED ) ); String content = attack.getRequestContent(); assertThat( content, containsString( "<!-- ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc -->" ) ); }
@Test public void untamperedFirst() { AttackModel attack = impl.nextAttack(); assertThat( attack.getRequestType(), is( RequestType.UNTAMPERED ) ); }