on 09-16-2015 1:55 PM
we are working with Hybris 5.6 and now some unittests of commercefacades fail:
OrderPopulatorTest OrderHistoryPopulatorTest
with org.mockito.exceptions.base.MockitoException: Cannot mock/spy class de.hybris.platform.core.enums.OrderStatus Mockito cannot mock/spy following: - final classes - anonymous classes - primitive types at de.hybris.platform.commercefacades.order.converters.populator.OrderPopulatorTest.testConvert(OrderPopulatorTest.java:121)
I'm not sure if this an issue of Hybris 5.6 or it was there before. Anyway, we wan't to run all unittests on the Jenkins.. Any ideas/shelp on that?
One of my colleagues finally found the problem: We have configured a new value for the item "OrderStatus" that way:
<enumtype code="OrderStatus" autocreate="false" generate="true">
<value code="APPROVED"/>
</enumtype>
And at the first glance nothing's really bad with that, ok? But we have forgotten to declare dynamic="true" which lets Hybris generate a real enum class for OrderStatus and this finally cannot be mocked! So, the solution is:
<enumtype code="OrderStatus" autocreate="false" generate="true" dynamic="true">
<value code="APPROVED"/>
</enumtype>
and Hybris then generates a real Java class
Thanks to Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.