ScenarioBeanUtil { public static Field getField(Class<?> clazz, String fieldName) { return internalGetField(clazz.getCanonicalName(), clazz, fieldName); } private  ScenarioBeanUtil(); static T fillBean(String className, Map<List<String>, Object> params, ClassLoader classLoader); @SuppressWarnings("unchecked") static T fillBean(ValueWrapper<Object> initialInstance, String className, Map<List<String>, Object> params, ClassLoader classLoader); static ScenarioBeanWrapper<?> navigateToObject(Object rootObject, List<String> steps); static ScenarioBeanWrapper<?> navigateToObject(Object rootObject, List<String> steps, boolean createIfNull); static Object convertValue(String className, Object cleanValue, ClassLoader classLoader); static String revertValue(Object cleanValue); @SuppressWarnings("unchecked") static Class<T> loadClass(String className, ClassLoader classLoader); static Field getField(Class<?> clazz, String fieldName);  }
@Test public void getFieldTest() { assertNotNull(getField(Person.class, "firstName")); assertNotNull(getField(SubPerson.class, "firstName")); assertNotNull(getField(SubPerson.class, "additionalField")); assertThatThrownBy(() -> getField(Person.class, "notExistingField")) .isInstanceOf(ScenarioException.class) .hasMessageStartingWith("Impossible to find field with name "); }