File junkFile = new File(flow.git().getRepository().getWorkTree(), "junk.txt");
FileUtils.writeStringToFile(junkFile, "I am junk");
flow.git().add().addFilepattern(junkFile.getName()).call();
RevCommit localcommit = flow.git().commit().setMessage("adding junk file").call();
HotfixFinishExtensionForTests extension = new HotfixFinishExtensionForTests();
extension.withException(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT, ExtensionFailStrategy.WARN);
ReleaseMergeResult result = flow.hotfixFinish("1.0").setFetch(true).setPush(true).setExtension(extension).call();
assertTrue(result.wasSuccessful());
assertTrue("before was not called", extension.wasCalled(BaseExtensionForTests.BEFORE));
assertTrue("beforeFetch was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_FETCH));
assertTrue("afterFetch was not called", extension.wasCalled(BaseExtensionForTests.AFTER_FETCH));
assertTrue("beforeMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_CHECKOUT));
assertTrue("afterMasterCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_CHECKOUT));
assertTrue("beforeMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_MASTER_MERGE));
assertTrue("afterMasterMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_MASTER_MERGE));
assertTrue("beforeDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_CHECKOUT));
assertTrue("afterDevelopCheckout was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_CHECKOUT));
assertTrue("beforeDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.BEFORE_DEVELOP_MERGE));
assertTrue("afterDevelopMerge was not called", extension.wasCalled(BaseExtensionForTests.AFTER_DEVELOP_MERGE));
assertTrue("afterPush was not called", extension.wasCalled(BaseExtensionForTests.AFTER_PUSH));
assertTrue("after was not called", extension.wasCalled(BaseExtensionForTests.AFTER));
}