@Test public void shouldReturnCorrectValueWhenObjectIsNull() { Object actual = getGenerator().generate(null, null, null); assertNotNull(actual); assertEquals(getExpectedValue(true), actual); }
@Override public Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions) { T value = (T) PropertyUtil.safeGetProperty(obj, getPropertName()); value = modify(value); if (null == value) { throw new IllegalStateException("The value for property [" + getPropertName() + "] should not be null"); } return value; }
AbstractObjectValueGenerator implements ObjectValueGenerator { @Override public Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions) { T value = (T) PropertyUtil.safeGetProperty(obj, getPropertName()); value = modify(value); if (null == value) { throw new IllegalStateException("The value for property [" + getPropertName() + "] should not be null"); } return value; } }
AbstractObjectValueGenerator implements ObjectValueGenerator { @Override public Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions) { T value = (T) PropertyUtil.safeGetProperty(obj, getPropertName()); value = modify(value); if (null == value) { throw new IllegalStateException("The value for property [" + getPropertName() + "] should not be null"); } return value; }  }
AbstractObjectValueGenerator implements ObjectValueGenerator { @Override public Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions) { T value = (T) PropertyUtil.safeGetProperty(obj, getPropertName()); value = modify(value); if (null == value) { throw new IllegalStateException("The value for property [" + getPropertName() + "] should not be null"); } return value; }  @Override Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions); }
AbstractObjectValueGenerator implements ObjectValueGenerator { @Override public Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions) { T value = (T) PropertyUtil.safeGetProperty(obj, getPropertName()); value = modify(value); if (null == value) { throw new IllegalStateException("The value for property [" + getPropertName() + "] should not be null"); } return value; }  @Override Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions);  }