@Test(expected = ComplexGepardException.class) public void testGenerateTestlistFailureWhenExceptionOccuresDuringFileWriting() { // GIVEN String folder = "build"; String filePath = ""; environment.setProperty(Environment.GEPARD_TESTLIST_FAILURE_PATH, folder); environment.setProperty(Environment.GEPARD_TESTLIST_FAILURE_FILE, filePath); // WHEN underTest.generateTestlistFailure(); // THEN expected EXCEPTION }
@Test public void testGenerateTestlistFailure() { // GIVEN String folder = "build"; String filePath = "GeneratedFailure.txt"; environment.setProperty(Environment.GEPARD_TESTLIST_FAILURE_PATH, folder); environment.setProperty(Environment.GEPARD_TESTLIST_FAILURE_FILE, filePath); // WHEN underTest.generateTestlistFailure(); // THEN File f = new File(folder + "/" + filePath); if (f.exists()) { Assert.assertTrue(true); } else { Assert.assertTrue(false); } }