}
@Test
public void testFloatValueAnnotation() {
FloatValuePojo pojo = factory.manufacturePojo(FloatValuePojo.class);
Assert.assertNotNull("The pojo cannot be null!", pojo);
float floatFieldWithMinValueOnly = pojo.getFloatFieldWithMinValueOnly();
Assert.assertTrue(
"The float field with min value only must have value greater than "
+ PodamTestConstants.NUMBER_FLOAT_MIN_VALUE,
floatFieldWithMinValueOnly >= PodamTestConstants.NUMBER_FLOAT_MIN_VALUE);
float floatFieldWithMaxValueOnly = pojo.getFloatFieldWithMaxValueOnly();
Assert.assertTrue(
"The float field with max value only can only have a value less or equal than "
+ PodamTestConstants.NUMBER_FLOAT_ONE_HUNDRED,
floatFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_FLOAT_ONE_HUNDRED);
float floatFieldWithMinAndMaxValue = pojo
.getFloatFieldWithMinAndMaxValue();
Assert.assertTrue(
"The float field with min and max value must have a value between "
+ PodamTestConstants.NUMBER_FLOAT_MIN_VALUE + " and "
+ PodamTestConstants.NUMBER_FLOAT_MAX_VALUE,
floatFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_FLOAT_MIN_VALUE
&& floatFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_FLOAT_MAX_VALUE);
Float floatObjectFieldWithMinValueOnly = pojo
.getFloatObjectFieldWithMinValueOnly();
Assert.assertNotNull(
"The float object attribute with min value only cannot be null!",
floatObjectFieldWithMinValueOnly);
Assert.assertTrue(
"The float object attribute with min value only must have a value greater or equal than "
+ PodamTestConstants.NUMBER_FLOAT_MIN_VALUE,
floatObjectFieldWithMinValueOnly >= PodamTestConstants.NUMBER_FLOAT_MIN_VALUE);
Float floatObjectFieldWithMaxValueOnly = pojo
.getFloatObjectFieldWithMaxValueOnly();
Assert.assertNotNull(
"The float object attribute with max value only cannot be null!",
floatObjectFieldWithMaxValueOnly);
Assert.assertTrue(
"The float object attribute with max value only must have a value less than or equal to "
+ PodamTestConstants.NUMBER_FLOAT_ONE_HUNDRED,
floatObjectFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_FLOAT_ONE_HUNDRED);
Float floatObjectFieldWithMinAndMaxValue = pojo
.getFloatObjectFieldWithMinAndMaxValue();
Assert.assertNotNull(
"The float object attribute with min and max value cannot be null!",
floatObjectFieldWithMinAndMaxValue);
Assert.assertTrue(
"The float object attribute with min and max value only must have a value between "
+ PodamTestConstants.NUMBER_FLOAT_MIN_VALUE
+ " and "
+ PodamTestConstants.NUMBER_FLOAT_MAX_VALUE,
floatObjectFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_FLOAT_MIN_VALUE
&& floatObjectFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_FLOAT_MAX_VALUE);
float floatFieldWithPreciseValue = pojo.getFloatFieldWithPreciseValue();
Assert.assertTrue(
"The float field with precise value should have a value of "
+ PodamTestConstants.FLOAT_PRECISE_VALUE,
floatFieldWithPreciseValue == Float
.valueOf(PodamTestConstants.FLOAT_PRECISE_VALUE));
Float floatObjectFieldWithPreciseValue = pojo
.getFloatObjectFieldWithPreciseValue();
Assert.assertNotNull(
"The float object field with precise value cannot be null!",
floatObjectFieldWithPreciseValue);
Assert.assertTrue(