use of org.junit.jupiter.api.RepeatedTest in project junit5 by junit-team.
the class RepeatedTestExtension method provideTestTemplateInvocationContexts.
@Override
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context) {
Method testMethod = context.getRequiredTestMethod();
String displayName = context.getDisplayName();
RepeatedTest repeatedTest = AnnotationUtils.findAnnotation(testMethod, RepeatedTest.class).get();
int totalRepetitions = totalRepetitions(repeatedTest, testMethod);
RepeatedTestDisplayNameFormatter formatter = displayNameFormatter(repeatedTest, testMethod, displayName);
// @formatter:off
return IntStream.rangeClosed(1, totalRepetitions).mapToObj(repetition -> new RepeatedTestInvocationContext(repetition, totalRepetitions, formatter));
// @formatter:on
}
use of org.junit.jupiter.api.RepeatedTest in project component-runtime by Talend.
the class JUnit5HttpsApiTest method getProxy.
// just ensure it is reentrant
@RepeatedTest(5)
void getProxy() throws Exception {
final Response response = get();
assertEquals(HttpURLConnection.HTTP_OK, response.status());
assertEquals(new String(response.payload()), "worked as expected");
assertEquals("text/plain", response.headers().get("content-type"));
assertEquals("true", response.headers().get("mocked"));
assertEquals("true", response.headers().get("X-Talend-Proxy-JUnit"));
}
Aggregations