### Question:
AllureRunListener extends RunListener { @Override public void testFailure(Failure failure) { if (failure.getDescription().isTest()) { fireTestCaseFailure(failure.getException()); } else { startFakeTestCase(failure.getDescription()); fireTestCaseFailure(failure.getException()); finishFakeTestCase(); } }  void testSuiteStarted(Description description); @Override void testStarted(Description description); @Override void testFailure(Failure failure); @Override void testAssumptionFailure(Failure failure); @Override void testIgnored(Description description); @Override void testFinished(Description description); void testSuiteFinished(String uid); @Override void testRunFinished(Result result); String generateSuiteUid(String suiteName); String getSuiteUid(Description description); String getIgnoredMessage(Description description); void startFakeTestCase(Description description); void finishFakeTestCase(); void fireTestCaseFailure(Throwable throwable); void fireClearStepStorage(); Allure getLifecycle(); void setLifecycle(Allure lifecycle); Map<String, String> getSuites();  }### Answer:
@Test public void testFailureTest() throws Exception { Description description = mock(Description.class); when(description.isTest()).thenReturn(true); Throwable exception = mock(Throwable.class); Failure failure = mockFailureWith(exception, description); runListener.testFailure(failure); verify(allure).fire(eq(new TestCaseFailureEvent().withThrowable(exception))); }
@Test public void testFailureWithAssumptionTest() throws Exception { Description description = mock(Description.class); when(description.isTest()).thenReturn(true); Throwable exception = mock(AssumptionViolatedException.class); Failure failure = mockFailureWith(exception, description); runListener.testFailure(failure); verify(allure).fire(eq(new TestCaseCanceledEvent().withThrowable(exception))); }