Closed xushijiaxuhuanhuan closed 2 years ago
Do you mean issue https://github.com/alibaba/testable-mock/issues/145 ?
I tried below test with TestableMock 0.7.5, and it works well. Could you provide more information about the issue ?
public class CreateBigDecimalTest {
@Test
public void testBigDecimals() {
BigDecimal bigDecimal = OmniConstructor.newInstance(BigDecimal.class);
assertEquals(0, bigDecimal.intValue());
}
@Test
public void testDate() {
Date date = OmniConstructor.newInstance(Date.class);
assertTrue(date.getTime() > 0);
}
}
文件已查收!
I should mention that, you need to enable the byte-code enhancement for omni constructor by adding below content into your testable.properties
file:
omni.constructor.enhance.enable = true
Check the doc for more details. https://alibaba.github.io/testable-mock/#/zh-cn/doc/omni-constructor
文件已查收!
BigDecimial and date bug still exist in version 0.7.5