use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class AttachmentsTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, launchUuid, suitedUuid, testClassUuid, stepUuid);
mockLogging(client);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters(), executor);
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class FlakyAnnotationTest 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);
}
use of com.epam.reportportal.service.ReportPortal in project seleniumRobot by bhecquet.
the class ReportPortalService method getLaunchOverriddenProperties.
private static Supplier<Launch> getLaunchOverriddenProperties() {
ListenerParameters parameters = new ListenerParameters(PropertiesLoader.load());
parameters.setCallbackReportingEnabled(true);
ReportPortal reportPortal = ReportPortal.builder().withParameters(parameters).build();
StartLaunchRQ rq = buildStartLaunch(reportPortal.getParameters());
rpLaunch = reportPortal.newLaunch(rq);
return () -> rpLaunch;
}
use of com.epam.reportportal.service.ReportPortal in project vividus by vividus-framework.
the class AdaptedDelegatingReportPortalStoryReporterTests method shouldSendStacktraceToTheReportPortal.
@Test
void shouldSendStacktraceToTheReportPortal() {
var event = mock(AssertionFailedEvent.class);
var softAssertionError = mock(SoftAssertionError.class);
when(event.getSoftAssertionError()).thenReturn(softAssertionError);
when(softAssertionError.getError()).thenReturn(new AssertionError());
var failedStep = mock(TestItemLeaf.class);
when(reporter.getLastStep()).thenReturn(Optional.of(failedStep));
var id = "id";
var just = Maybe.just(id);
when(failedStep.getItemId()).thenReturn(just);
try (MockedStatic<ReportPortal> reportPortal = Mockito.mockStatic(ReportPortal.class)) {
adaptedReporter.onAssertionFailure(event);
reportPortal.verify(() -> ReportPortal.emitLog(eq(just), argThat(f -> {
SaveLogRQ saveLogRQ = f.apply(id);
Assertions.assertAll(() -> assertEquals(id, saveLogRQ.getItemUuid()), () -> assertEquals("ERROR", saveLogRQ.getLevel()), () -> assertTrue(saveLogRQ.getLogTime().getTime() <= LocalDateTime.now().toInstant(ZoneOffset.UTC).toEpochMilli()), () -> assertTrue(saveLogRQ.getMessage().matches("(?s)java.lang.AssertionError.+(.+\\.java.+)+.+")));
return true;
})));
}
}
use of com.epam.reportportal.service.ReportPortal in project agent-java-testNG by reportportal.
the class CallbackReportingIntegrationTest method initMocks.
@BeforeEach
@SuppressWarnings("unchecked")
public void initMocks() {
ReportPortalClient reportPortalClient = mock(ReportPortalClient.class);
when(reportPortalClient.startLaunch(any())).thenReturn(Maybe.just(new StartLaunchRS("launchUuid", 1L)));
Maybe<ItemCreatedRS> suiteMaybe = Maybe.just(new ItemCreatedRS(suitedUuid, suitedUuid));
when(reportPortalClient.startTestItem(any())).thenReturn(suiteMaybe);
Maybe<ItemCreatedRS> testClassMaybe = Maybe.just(new ItemCreatedRS(testClassUuid, testClassUuid));
when(reportPortalClient.startTestItem(eq(suiteMaybe.blockingGet().getId()), any())).thenReturn(testClassMaybe);
Maybe<ItemCreatedRS> testMethodMaybe = Maybe.just(new ItemCreatedRS(testMethodUuid, testMethodUuid));
when(reportPortalClient.startTestItem(eq(testClassMaybe.blockingGet().getId()), any())).thenReturn(testMethodMaybe);
Maybe<OperationCompletionRS> finishResponse = Maybe.just(new OperationCompletionRS("finished"));
when(reportPortalClient.finishTestItem(eq(testMethodUuid), any())).thenReturn(finishResponse);
when(reportPortalClient.log(any(List.class))).thenReturn(Maybe.just(new BatchSaveOperatingRS()));
when(reportPortalClient.log(any(SaveLogRQ.class))).thenReturn(Maybe.just(new EntryCreatedAsyncRS("logId")));
ListenerParameters params = standardParameters();
params.setCallbackReportingEnabled(true);
final ReportPortal reportPortal = ReportPortal.create(reportPortalClient, params);
CallbackReportingListener.initReportPortal(reportPortal);
}
Aggregations