ExtractionDiffCommand extends Command { String buildFailSafeMailCommand() { return "echo '" + failSafeMessage + "' | mail -s 'Extraction diff command failed for branch: " + pushToBranchName + "' " + failSafeEmail; }  @Override void execute();  }
@Test public void buildFailSafeMailCommand() { ExtractionDiffCommand extractionDiffCommand = new ExtractionDiffCommand(); extractionDiffCommand.failSafeEmail = "username@test.com"; extractionDiffCommand.failSafeMessage = "https: extractionDiffCommand.pushToBranchName = "BRANCH"; assertEquals("echo 'https: }
@Test public void buildFailSafeMailCommandAllNull() { ExtractionDiffCommand extractionDiffCommand = new ExtractionDiffCommand(); assertEquals("echo 'null' | mail -s 'Extraction diff command failed for branch: null' null", extractionDiffCommand.buildFailSafeMailCommand()); }