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"));
}
Aggregations