mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-27 20:57:35 +01:00
Fix cast exception in integration test
- Although the class only has fields of Property type it would appear that CircleCI et al. may use libraries that add fields to classes later on, so we need to check for the field type
This commit is contained in:
parent
d0b7d0ff06
commit
752ebe5022
@ -35,10 +35,12 @@ public class NewSettingIntegrationTest {
|
||||
public static void generatePropertyMap() {
|
||||
propertyMap = new PropertyMap();
|
||||
for (Field field : TestConfiguration.class.getDeclaredFields()) {
|
||||
Property<?> property =
|
||||
(Property<?>) ReflectionTestUtils.getFieldValue(TestConfiguration.class, null, field.getName());
|
||||
String[] comments = new String[]{"Comment for '" + property.getPath() + "'"};
|
||||
propertyMap.put(property, comments);
|
||||
Object fieldValue = ReflectionTestUtils.getFieldValue(TestConfiguration.class, null, field.getName());
|
||||
if (fieldValue instanceof Property<?>) {
|
||||
Property<?> property = (Property<?>) fieldValue;
|
||||
String[] comments = new String[]{"Comment for '" + property.getPath() + "'"};
|
||||
propertyMap.put(property, comments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user