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) {
|
for (BeanDefinition component : components) {
|
||||||
Class<?> clazz = Class.forName(component.getBeanClassName());
|
Class<?> clazz = Class.forName(component.getBeanClassName());
|
||||||
boolean isAbstract = Modifier.isAbstract(clazz.getModifiers());
|
boolean isAbstract = Modifier.isAbstract(clazz.getModifiers());
|
||||||
|
if (isAbstract) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
boolean matchesExpectedSerialVersion = ObjectStreamClass.lookup(clazz)
|
boolean matchesExpectedSerialVersion = ObjectStreamClass.lookup(clazz)
|
||||||
.getSerialVersionUID() == securitySerialVersionUid;
|
.getSerialVersionUID() == securitySerialVersionUid;
|
||||||
if (!isAbstract && matchesExpectedSerialVersion) {
|
boolean isUnderTest = generatorByClassName.containsKey(clazz);
|
||||||
|
if (matchesExpectedSerialVersion || isUnderTest) {
|
||||||
classes.add(clazz);
|
classes.add(clazz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue