@SuppressWarnings("unchecked") @Test public void getSuiteUidTest() throws Exception { Description description = mock(Description.class); when(description.getClassName()).thenReturn("some.suite.name"); Map<String, String> fakeSuites = (Map<String, String>) mock(Map.class); doReturn(true).when(fakeSuites).containsKey(anyString()); doReturn(fakeSuites).when(runListener).getSuites(); runListener.getSuiteUid(description); verify(fakeSuites).get("some.suite.name"); }
public String getSuiteUid(Description description) { String suiteName = description.getClassName(); if (!getSuites().containsKey(suiteName)) { Class testClass = description.getTestClass(); Description suiteDescription; if (testClass != null) { suiteDescription = Description.createSuiteDescription(testClass); } else { suiteDescription = Description.createSuiteDescription(description.getClassName()); } testSuiteStarted(suiteDescription); } return getSuites().get(suiteName); }
AllureRunListener extends RunListener { public String getSuiteUid(Description description) { String suiteName = description.getClassName(); if (!getSuites().containsKey(suiteName)) { Class testClass = description.getTestClass(); Description suiteDescription; if (testClass != null) { suiteDescription = Description.createSuiteDescription(testClass); } else { suiteDescription = Description.createSuiteDescription(description.getClassName()); } testSuiteStarted(suiteDescription); } return getSuites().get(suiteName); } }
AllureRunListener extends RunListener { public String getSuiteUid(Description description) { String suiteName = description.getClassName(); if (!getSuites().containsKey(suiteName)) { Class testClass = description.getTestClass(); Description suiteDescription; if (testClass != null) { suiteDescription = Description.createSuiteDescription(testClass); } else { suiteDescription = Description.createSuiteDescription(description.getClassName()); } testSuiteStarted(suiteDescription); } return getSuites().get(suiteName); }  }
AllureRunListener extends RunListener { public String getSuiteUid(Description description) { String suiteName = description.getClassName(); if (!getSuites().containsKey(suiteName)) { Class testClass = description.getTestClass(); Description suiteDescription; if (testClass != null) { suiteDescription = Description.createSuiteDescription(testClass); } else { suiteDescription = Description.createSuiteDescription(description.getClassName()); } testSuiteStarted(suiteDescription); } return getSuites().get(suiteName); }  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(); }
AllureRunListener extends RunListener { public String getSuiteUid(Description description) { String suiteName = description.getClassName(); if (!getSuites().containsKey(suiteName)) { Class testClass = description.getTestClass(); Description suiteDescription; if (testClass != null) { suiteDescription = Description.createSuiteDescription(testClass); } else { suiteDescription = Description.createSuiteDescription(description.getClassName()); } testSuiteStarted(suiteDescription); } return getSuites().get(suiteName); }  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();  }