Search in sources :

Example 1 with SingleTest

use of com.epam.reportportal.junit5.features.coderef.SingleTest in project agent-java-junit5 by reportportal.

the class CodeReferenceTest method verify_static_test_code_reference_generation.

@Test
public void verify_static_test_code_reference_generation() {
    TestUtils.runClasses(SingleTest.class);
    Launch launch = CodeReferenceTestExtension.LAUNCH;
    ArgumentCaptor<StartTestItemRQ> suiteCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);
    // Start parent Suite
    verify(launch, times(1)).startTestItem(suiteCaptor.capture());
    ArgumentCaptor<StartTestItemRQ> testCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);
    // Start a test
    verify(launch, times(1)).startTestItem(notNull(), testCaptor.capture());
    String className = SingleTest.class.getCanonicalName();
    StartTestItemRQ suiteRq = suiteCaptor.getValue();
    assertThat(suiteRq.getCodeRef(), equalTo(className));
    StartTestItemRQ testRq = testCaptor.getValue();
    assertThat(testRq.getCodeRef(), equalTo(className + ".singleTest"));
}
Also used : Launch(com.epam.reportportal.service.Launch) StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) Test(org.junit.jupiter.api.Test) SingleTest(com.epam.reportportal.junit5.features.coderef.SingleTest) SingleDynamicTest(com.epam.reportportal.junit5.features.coderef.SingleDynamicTest)

Aggregations

SingleDynamicTest (com.epam.reportportal.junit5.features.coderef.SingleDynamicTest)1 SingleTest (com.epam.reportportal.junit5.features.coderef.SingleTest)1 Launch (com.epam.reportportal.service.Launch)1 StartTestItemRQ (com.epam.ta.reportportal.ws.model.StartTestItemRQ)1 Test (org.junit.jupiter.api.Test)1