QuickBuilder icon indicating copy to clipboard operation
QuickBuilder copied to clipboard

Error in spring environment

Open ghost opened this issue 9 years ago • 2 comments

It works well on unit testing, but failed in my spring enterprise environment. Is QuickBuilder for testing only?

The error seems weird: java.lang.ClassCastException: cc.foo.data.entity.SzlbProposalEntity$SzlbProposalBuilder__quickbuilder__ cannot be cast to cc.foo.data.entity.SzlbProposalEntity$SzlbProposalBuilder at cc.foo.data.entity.SzlbProposalEntity.builder(SzlbProposalEntity.java:67) at cc.foo.data.entity.SzlbProposalEntity.builder(SzlbProposalEntity.java:76)

ghost avatar Jan 11 '17 11:01 ghost

public static interface SzlbProposalBuilder extends org.pitest.quickbuilder.Builder<SzlbProposalEntity> {

ghost avatar Jan 11 '17 11:01 ghost

QuickBuilder is intended for use in tests. This doesn't mean it couldn't be used for production code, but it isn't something I'd personally choose to do as I prefer to keep the amount of "magic" there to a minimum.

It looks like spring has created a sub class of the SzlbProposalBuilder. I'd have to see the code in its full context to understand why.

hcoles avatar Jan 11 '17 13:01 hcoles