Skip to content

Commit

Permalink
Add JSR-305 annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 19, 2024
1 parent 665ed20 commit e1cd629
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ protected void createSkippedSteps(ITestResult testResult) {
@Nullable
protected com.epam.ta.reportportal.ws.model.issue.Issue createIssue(@Nonnull ITestResult testResult) {
String stepName = createStepName(testResult);
List<ParameterResource> parameters = createStepParameters(testResult);
List<ParameterResource> parameters = ofNullable(createStepParameters(testResult)).orElse(Collections.emptyList());
return getMethodAnnotation(Issues.class, testResult).map(i -> IssueUtils.createIssue(i, stepName, parameters))
.orElseGet(() -> getMethodAnnotation(Issue.class, testResult).map(i -> IssueUtils.createIssue(i, stepName, parameters))
.orElse(null));
Expand Down Expand Up @@ -548,6 +548,7 @@ public void sendReportPortalMsg(final ITestResult result) {
* @param suite TestNG suite
* @return Request to ReportPortal
*/
@Nonnull
protected StartTestItemRQ buildStartSuiteRq(ISuite suite) {
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(suite.getName());
Expand Down Expand Up @@ -582,6 +583,7 @@ protected StartTestItemRQ buildStartTestItemRq(@Nonnull ITestContext testContext
* @param parameters Launch Configuration parameters
* @return Request to ReportPortal
*/
@Nonnull
protected StartLaunchRQ buildStartLaunchRq(ListenerParameters parameters) {
StartLaunchRQ rq = new StartLaunchRQ();
rq.setName(parameters.getLaunchName());
Expand Down Expand Up @@ -614,6 +616,7 @@ protected StartLaunchRQ buildStartLaunchRq(ListenerParameters parameters) {
* @return Request to ReportPortal
*/
@SuppressWarnings("unused")
@Nonnull
protected FinishExecutionRQ buildFinishLaunchRq(ListenerParameters parameters) {
FinishExecutionRQ rq = new FinishExecutionRQ();
rq.setEndTime(Calendar.getInstance().getTime());
Expand All @@ -627,6 +630,7 @@ protected FinishExecutionRQ buildFinishLaunchRq(ListenerParameters parameters) {
* @return Request to ReportPortal
*/
@SuppressWarnings("unused")
@Nonnull
protected FinishTestItemRQ buildFinishTestSuiteRq(ISuite suite) {
/* 'real' end time */
Date now = Calendar.getInstance().getTime();
Expand All @@ -641,6 +645,7 @@ protected FinishTestItemRQ buildFinishTestSuiteRq(ISuite suite) {
* @param testContext TestNG test context
* @return Request to ReportPortal
*/
@Nonnull
protected FinishTestItemRQ buildFinishTestRq(ITestContext testContext) {
FinishTestItemRQ rq = new FinishTestItemRQ();
rq.setEndTime(testContext.getEndDate());
Expand All @@ -653,6 +658,7 @@ protected FinishTestItemRQ buildFinishTestRq(ITestContext testContext) {
* @param testResult TestNG's testResult context
* @return Test/Step Parameters being sent to ReportPortal
*/
@Nullable
protected List<ParameterResource> createStepParameters(ITestResult testResult) {
List<ParameterResource> parameters = Lists.newArrayList();
parameters.addAll(createDataProviderParameters(testResult));
Expand Down

0 comments on commit e1cd629

Please sign in to comment.