Skip to content

Commit b7a315f

Browse files
author
Sergey Brenko
authored
Merge pull request #62 from zebrunner/develop
1.9.11 rc
2 parents daa2d98 + 78c954e commit b7a315f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/zebrunner/agent/testng/adapter/TestNGAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ private TestInvocationContext buildTestStartInvocationContext(ITestResult testRe
133133
}
134134

135135
private void setZebrunnerTestIdOnRerun(ITestResult testResult, ITestNGMethod testMethod, TestStartDescriptor testStartDescriptor) {
136-
if (RunContextHolder.isRerun()) {
136+
// testMethod is not available for BeforeClass configuration method, so we just skip this logic in such case
137+
if (RunContextHolder.isRerun() && testMethod != null) {
137138
ITestContext context = testResult.getTestContext();
138139
Object[] parameters = testResult.getParameters();
139140

src/main/java/com/zebrunner/agent/testng/listener/RetryService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ private static RetryItemContext getOrInitRetryItemContext(ITestNGMethod method,
9090
}
9191

9292
public static boolean isRetryFinished(ITestNGMethod method, ITestContext context) {
93+
if (method == null) {
94+
// method is not available for BeforeClass configuration method, so we just return true here
95+
return true;
96+
}
9397
return getRetryContext(context)
9498
.map(RetryContext::getRetryItemContexts)
9599
.map(retryItemContext -> retryItemContext.get(method.getParameterInvocationCount()))

0 commit comments

Comments
 (0)