public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }
public void enrich(Object testCase) { for (Field field : SecurityActions.getFieldsWithAnnotation(testCase.getClass(), ContainerResource.class)) { Object value = null; try { Annotation[] qualifiers = filterAnnotations(field.getAnnotations()); // null value will throw exception in lookup value = lookup(field.getType(), field.getAnnotation(ContainerResource.class), qualifiers); } catch (Exception e) { throw new RuntimeException("Could not lookup value for field " + field, e); } try { if (!field.isAccessible()) { field.setAccessible(true); } field.set(testCase, value); } catch (Exception e) { throw new RuntimeException("Could not set value on field " + field + " using " + value); } } }