@Test public void testCreateErrorMethodTransientFieldClash() { ConfigException ex = assertThrows(ConfigException.class, () -> { ReflectionUtil.getPropertyAccessors(MethodTransientFieldClashBean.class); }); assertThat(ex.getMessage(), stringContainsInOrder(List.of("@Value", "method", "@Transient", "prop1"))); }
static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil(); }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil();  }
ReflectionUtil { static <T> Map<String, PropertyAccessor<?>> getPropertyAccessors(Class<T> type) { Set<String> transientProps = new HashSet<>(); Map<String, PropertyAccessor<?>> propertyAccessors = new HashMap<>(); initMethods(type, transientProps, propertyAccessors); initFields(type, transientProps, propertyAccessors); return propertyAccessors; } private  ReflectionUtil();   }