test/src/main/java/de/taimos/dvalin/test/inject/InjectionUtils.java
/**
     * inject String in field that is annotated with <em>@Value</em>
     *
     * @param bean  the bean to inject the value into
     * @param field the name of the target field
     * @param value the value to inject
     */
inject String in field that is annotated with @Value
@param bean  the bean to inject the value into
@param field the name of the target field
@param value the value to inject
inject String in field that is annotated with @Value @param bean the bean to inject the value into @param field the name of the target field @param value the value to inject
public static void injectValue(Object bean, String field, String value) {
        try {
            Field beanField = getField(bean.getClass(), field);
            if (beanField.isAnnotationPresent(Value.class) && beanField.getType().equals(String.class)) {
                doInjection(bean, value, beanField);
            } else {
                throw new RuntimeException("Did not find field " + field + " of type String to inject value");
            }
        } catch (NoSuchFieldException e) {
            throw new RuntimeException("Did not find field " + field + " to inject value");
        } catch (SecurityException e) {
            throw new RuntimeException("Error injecting value due to access violation", e);
        }
    }
public static void injectValue ( Object bean , String field , String value ) { try { Field beanField = getField ( bean . getClass ( ) , field ) ; if ( beanField . isAnnotationPresent ( Value . class ) && beanField . getType ( ) . equals ( String . class ) ) { doInjection ( bean , value , beanField ) ; } else { throw new RuntimeException ( "Did not find field " + field + " of type String to inject value" ) ; } } catch ( NoSuchFieldException e ) { throw new RuntimeException ( "Did not find field " + field + " to inject value" ) ; } catch ( SecurityException e ) { throw new RuntimeException ( "Error injecting value due to access violation" , e ) ; } }
inject String in field that is annotated with <em>@Value</em>
 @param bean  the bean to inject the value into
 @param field the name of the target field
 @param value the value to inject
inject String in field that is annotated with <em > @Value< / em > @param bean the bean to inject the value into @param field the name of the target field @param value the value to inject