@@ -168,12 +168,12 @@ public void onTestStart(final ITestResult testResult) {
168168 labels .addAll (getLabels (testResult ));
169169 final TestResult result = new TestResult ()
170170 .withUuid (current .getUuid ())
171- .withHistoryId (getHistoryId (method . getQualifiedName (), Collections .emptyMap ()))
171+ .withHistoryId (getHistoryId (getQualifiedName (method ), Collections .emptyMap ()))
172172 .withName (firstNonEmpty (
173173 method .getDescription (),
174174 method .getMethodName (),
175- method . getQualifiedName ()).orElse ("Unknown" ))
176- .withFullName (testResult . getMethod (). getQualifiedName ())
175+ getQualifiedName (method )).orElse ("Unknown" ))
176+ .withFullName (getQualifiedName (method ))
177177 .withStatusDetails (new StatusDetails ()
178178 .withFlaky (isFlaky (testResult ))
179179 .withMuted (isMuted (testResult )))
@@ -311,14 +311,18 @@ private String createFakeContainer(final ITestNGMethod method, final Current cur
311311 final String parentUuid = currentTestContainer .get ();
312312 final TestResultContainer container = new TestResultContainer ()
313313 .withUuid (parentUuid )
314- .withName (method . getQualifiedName ())
314+ .withName (getQualifiedName (method ))
315315 .withStart (System .currentTimeMillis ())
316316 .withDescription (method .getDescription ())
317317 .withChildren (current .getUuid ());
318318 getLifecycle ().startTestContainer (container );
319319 return parentUuid ;
320320 }
321321
322+ private String getQualifiedName (final ITestNGMethod method ) {
323+ return method .getRealClass ().getName () + "." + method .getMethodName ();
324+ }
325+
322326 private FixtureResult getFixtureResult (final ITestNGMethod method ) {
323327 return new FixtureResult ()
324328 .withName (method .getMethodName ())
@@ -343,7 +347,7 @@ public void afterInvocation(final IInvokedMethod method, final ITestResult testR
343347
344348 if (testMethod .isBeforeMethodConfiguration () || testMethod .isAfterMethodConfiguration ()) {
345349 final String containerUuid = currentTestContainer .get ();
346- validateContainerExists (testMethod . getQualifiedName (), containerUuid );
350+ validateContainerExists (getQualifiedName (testMethod ), containerUuid );
347351 currentTestContainer .remove ();
348352 getLifecycle ().stopTestContainer (containerUuid );
349353 getLifecycle ().writeTestContainer (containerUuid );
@@ -429,12 +433,14 @@ private <T extends Annotation> List<T> getAnnotationsOnMethod(final ITestResult
429433 .collect (Collectors .toList ());
430434 }
431435
436+ @ SuppressWarnings ("unchecked" )
432437 private <T extends Annotation > List <T > getAnnotationsOnClass (final ITestResult result , final Class <T > clazz ) {
433438 return Stream .of (result )
434439 .map (ITestResult ::getTestClass )
435440 .filter (Objects ::nonNull )
436441 .map (IClass ::getRealClass )
437442 .flatMap (aClass -> Stream .of (aClass .getAnnotationsByType (clazz )))
443+ .map (clazz ::cast )
438444 .collect (Collectors .toList ());
439445 }
440446
0 commit comments