WriteCommandInstruction extends AbstractCommandInstruction { public String getFilePath() { return this.filePath; } WriteCommandInstruction( Context context, String instruction, int line ); @Override List<ParsingError> doValidate(); String getContent(); String getFilePath();  }
@Test public void testReplacement() { String line = "Write this into %TMP%/"; WriteCommandInstruction instr = new WriteCommandInstruction( this.context, line, 1 ); List<ParsingError> errors = instr.validate(); Assert.assertEquals( 0, errors.size()); Assert.assertNotNull( instr.getFilePath()); Assert.assertFalse( "%TMP%/".equals( instr.getFilePath())); Assert.assertFalse( "%TMP%".equals( instr.getFilePath())); Assert.assertFalse( instr.getFilePath().contains( "%" )); }