XmlAttributeCount extends AbstractDoSAttack { @Override public DoSAttack minimal() { XmlAttributeCount xmlAttributeCount = new XmlAttributeCount(); xmlAttributeCount.currentName = this.currentName; xmlAttributeCount.currentNumberOfAttributes = MIN_NUMBER_OF_ATTRIBUTES; return xmlAttributeCount; } XmlAttributeCount(); @Override String getName(); @Override PayloadPosition[] getPossiblePossitions(); IterateModel getNumberOfAttributesIterator(); void setNumberOfAttributesIterator( IterateModel iterateModel ); String[] getNames(); void setNames( String[] names ); @Override boolean hasFurtherParams(); @Override void nextParam(); @Override List<DoSParam<?>> getCurrentParams(); @Override String getTamperedRequest( String xml, PayloadPosition payloadPosition ); @Override DoSAttack minimal(); @Override DoSAttack middle( DoSAttack aThat ); @Override void initialize(); @Override int compareTo( DoSAttack aThat );  }
@Test public void minimalTest() throws ParserConfigurationException { xmlAttributeCount.nextParam(); PayloadPosition payloadPosition = PayloadPosition.ELEMENT; String xml = IDoSTestHelper.createTestString( payloadPosition ); DoSAttack minimal = xmlAttributeCount.minimal(); String tamperedRequest = minimal.getTamperedRequest( xml, payloadPosition ); assertThat( tamperedRequest, containsString( "><attackElement a0=\"0\" a1=\"1\" /><" ) ); }