mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 20:21:02 +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,12 +35,14 @@ 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());
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldLoadAndReadAllProperties() {
|
||||
|
Loading…
Reference in New Issue
Block a user