Skip to content

Commit

Permalink
Use dynamic cast
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Brannen <[email protected]>
  • Loading branch information
marcphilipp and sbrannen authored Jan 25, 2025
1 parent b13ac6e commit a8c91a8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public ExclusiveResourceCollector getExclusiveResourceCollector() {
public Set<ResourceLocksProvider.Lock> evaluateResourceLocksProvider(ResourceLocksProvider provider) {
List<Class<?>> enclosingInstanceTypes = getParent() //
.filter(ClassBasedTestDescriptor.class::isInstance) //
.map(parent -> ((ClassBasedTestDescriptor) parent).getEnclosingTestClasses()) //
.map(ClassBasedTestDescriptor.class::cast) //
.map(ClassBasedTestDescriptor::getEnclosingTestClasses) //
.orElseGet(Collections::emptyList);
return provider.provideForMethod(enclosingInstanceTypes, getTestClass(), getTestMethod());
}
Expand Down

0 comments on commit a8c91a8

Please sign in to comment.