use of com.epam.reportportal.service.ReportPortal in project agent-java-junit5 by reportportal.
the class ReportPortalExtension method buildStartConfigurationRq.
/**
* Extension point to customize beforeXXX creation event/request
*
* @param method JUnit's test method reference
* @param parentContext JUnit's context of a parent item
* @param context JUnit's test context
* @param itemType a type of the item to build
* @return Request to ReportPortal
*/
@Nonnull
protected StartTestItemRQ buildStartConfigurationRq(@Nonnull Method method, @Nonnull ExtensionContext parentContext, @Nonnull ExtensionContext context, @Nonnull ItemType itemType) {
StartTestItemRQ rq = new StartTestItemRQ();
rq.setStartTime(Calendar.getInstance().getTime());
Optional<Class<?>> testClass = context.getTestClass();
if (testClass.isPresent()) {
rq.setName(createConfigurationName(testClass.get(), method));
rq.setDescription(createConfigurationDescription(testClass.get(), method));
} else {
rq.setName(createConfigurationName(method.getDeclaringClass(), method));
rq.setDescription(createConfigurationDescription(method.getDeclaringClass(), method));
}
String uniqueId = parentContext.getUniqueId() + "/[method:" + method.getName() + "()]";
rq.setUniqueId(uniqueId);
ofNullable(context.getTags()).ifPresent(it -> rq.setAttributes(it.stream().map(tag -> new ItemAttributesRQ(null, tag)).collect(Collectors.toSet())));
rq.setType(itemType.name());
rq.setRetry(false);
String codeRef = method.getDeclaringClass().getCanonicalName() + "." + method.getName();
rq.setCodeRef(codeRef);
TestCaseIdEntry caseId = ofNullable(method.getAnnotation(TestCaseId.class)).map(TestCaseId::value).map(TestCaseIdEntry::new).orElseGet(() -> TestCaseIdUtils.getTestCaseId(codeRef, Collections.emptyList()));
rq.setTestCaseId(ofNullable(caseId).map(TestCaseIdEntry::getId).orElse(null));
return rq;
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class LinkAnnotationTest method initMocks.
@BeforeEach
public void initMocks() {
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class MethodNestedStepsTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, namedUuid("launchUuid"), suitedUuid, testUuid, stepUuid);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
mockLogging(client);
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class MutedAnnotationTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, namedUuid("launchUuid"), suitedUuid, testClassUuid, stepUuids);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class RuntimeUpdatesTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, namedUuid("launchUuid"), suitedUuid, testClassUuid, stepUuid);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
Aggregations