autofixture.generators.throwables.ErrorGenerator Maven / Gradle / Ivy
package autofixture.generators.throwables;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
public class ErrorGenerator implements InstanceGenerator {
@Override
public boolean appliesTo(final InstanceType instanceType) {
return instanceType.isRawTypeAssignableFrom(Error.class);
}
@SuppressWarnings("unchecked")
@Override
public T next(final InstanceType instanceType, final FixtureContract fixture) {
return (T) new Error(fixture.create(String.class));
}
@Override
public T nextEmpty(final InstanceType instanceType, final FixtureContract fixture) {
return next(instanceType, fixture);
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}