autofixture.generators.throwables.ThrowableGenerator Maven / Gradle / Ivy
package autofixture.generators.throwables;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
/**
* Created by grzes on 15.04.2017.
*/
public class ThrowableGenerator implements InstanceGenerator {
@Override
public boolean appliesTo(final InstanceType instanceType) {
return instanceType.isRawTypeAssignableFrom(Throwable.class);
}
@SuppressWarnings("unchecked")
@Override
public T next(final InstanceType instanceType, final FixtureContract fixture) {
return (T) new Throwable(fixture.create(String.class));
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}