Skip to content

Conversation

@inpink
Copy link

@inpink inpink commented Nov 6, 2025

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19912

@inpink inpink marked this pull request as draft November 6, 2025 18:25
@inpink inpink force-pushed the inpink/HHH-19912 branch 2 times, most recently from ea9ba16 to 374fdb8 Compare November 6, 2025 18:31
Comment on lines 261 to 271
final Optional<SessionFactory> sfAnnRef = AnnotationSupport.findAnnotation(
context.getRequiredTestClass(),
SessionFactory.class
);

if (sfAnnRef.isPresent()) {
DropDataTiming configuredTiming = sfAnnRef.get().dropTestData();
if (configuredTiming == timing) {
scope.dropData();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it would be better to keep track of this "drop timing" as the SessionFactory annotation is discovered on the class / method and kept in the JUnit ExtensionContext.Store.

See FailureExpectedExtension for an example of how we do this alsewhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the helpful guidance! I’ll finish the revisions soon and mention you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants