Open
Description
I was using fixtures with a class with final fields and constructors only, without issue.
I had to change this class to an abstract class eventually, but fixtures were not working on the subclasses, throwing Could not find constructor with args [] on class
on the child class.
While there was no need for an empty constructor on the parent class.
Workaround: add an empty constructor on the parent class, override it with a private constructor on the child class.
public abstract class Transaction<T, U> {
private final String transactionId;
...
// Needed this to support fixtures
TransactionHistory() {
this(null);
}
TransactionHistory(final String transactionId) {
this(transactionId);
}
}
public class ChargeTransaction extends Transaction<ChargeRequest, ChargeResponse> {
private ChargeTransaction() {
}
}
Metadata
Metadata
Assignees
Labels
No labels