mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-01 02:49:11 +00:00
Include Classes Listed in Generator Map
This allows testing of classes that are serializable, but do not use Security's serialVersionUID. Issue gh-16276
This commit is contained in:
parent
82cc3ad5ec
commit
f7b9b7228f
@ -298,9 +298,13 @@ class SpringSecurityCoreVersionSerializableTests {
|
||||
for (BeanDefinition component : components) {
|
||||
Class<?> clazz = Class.forName(component.getBeanClassName());
|
||||
boolean isAbstract = Modifier.isAbstract(clazz.getModifiers());
|
||||
if (isAbstract) {
|
||||
continue;
|
||||
}
|
||||
boolean matchesExpectedSerialVersion = ObjectStreamClass.lookup(clazz)
|
||||
.getSerialVersionUID() == securitySerialVersionUid;
|
||||
if (!isAbstract && matchesExpectedSerialVersion) {
|
||||
boolean isUnderTest = generatorByClassName.containsKey(clazz);
|
||||
if (matchesExpectedSerialVersion || isUnderTest) {
|
||||
classes.add(clazz);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user