Display concrete test method name for @@DualDatabaseTest (#876)

This commit is contained in:
Shicong Huang 2020-11-18 20:56:08 -05:00 committed by GitHub
parent 96e53b46e5
commit c816c6c081

View file

@ -54,9 +54,11 @@ class DualDatabaseTestInvocationContextProvider implements TestTemplateInvocatio
public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts( public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(
ExtensionContext context) { ExtensionContext context) {
TestTemplateInvocationContext ofyContext = TestTemplateInvocationContext ofyContext =
createInvocationContext("Test Datastore", TransactionManagerFactory::ofyTm); createInvocationContext(
context.getDisplayName() + " with Datastore", TransactionManagerFactory::ofyTm);
TestTemplateInvocationContext sqlContext = TestTemplateInvocationContext sqlContext =
createInvocationContext("Test PostgreSQL", TransactionManagerFactory::jpaTm); createInvocationContext(
context.getDisplayName() + " with PostgreSQL", TransactionManagerFactory::jpaTm);
Method testMethod = context.getTestMethod().orElseThrow(IllegalStateException::new); Method testMethod = context.getTestMethod().orElseThrow(IllegalStateException::new);
if (testMethod.isAnnotationPresent(TestOfyAndSql.class)) { if (testMethod.isAnnotationPresent(TestOfyAndSql.class)) {
return Stream.of(ofyContext, sqlContext); return Stream.of(ofyContext, sqlContext);