}
@Test
public void testByteValueAnnotation() {
ByteValuePojo pojo = factory.manufacturePojo(ByteValuePojo.class);
Assert.assertNotNull("The Pojo cannot be null!", pojo);
byte byteFieldWithMinValueOnly = pojo.getByteFieldWithMinValueOnly();
Assert.assertTrue(
"The byte field with min value only should have a minimum value of zero!",
byteFieldWithMinValueOnly >= PodamTestConstants.NUMBER_INT_MIN_VALUE);
byte byteFieldWithMaxValueOnly = pojo.getByteFieldWithMaxValueOnly();
Assert.assertTrue(
"The byte field value cannot be greater than: "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
byteFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
byte byteFieldWithMinAndMaxValue = pojo
.getByteFieldWithMinAndMaxValue();
Assert.assertTrue(
"The byte field value must be between: "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE + " and "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
byteFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_INT_MIN_VALUE
&& byteFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
Byte byteObjectFieldWithMinValueOnly = pojo
.getByteObjectFieldWithMinValueOnly();
Assert.assertNotNull(
"The byte object with min value only cannot be null!",
byteObjectFieldWithMinValueOnly);
Assert.assertTrue(
"The byte object value must be greate or equal than: "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE,
byteObjectFieldWithMinValueOnly >= PodamTestConstants.NUMBER_INT_MIN_VALUE);
Byte byteObjectFieldWithMaxValueOnly = pojo
.getByteObjectFieldWithMaxValueOnly();
Assert.assertNotNull("The byte object field cannot be null",
byteObjectFieldWithMaxValueOnly);
Assert.assertTrue(
"The byte object field must have a value less or equal to "
+ PodamTestConstants.NUMBER_INT_ONE_HUNDRED,
byteObjectFieldWithMaxValueOnly <= PodamTestConstants.NUMBER_INT_ONE_HUNDRED);
Byte byteObjectFieldWithMinAndMaxValue = pojo
.getByteObjectFieldWithMinAndMaxValue();
Assert.assertNotNull("The byte object must not be null!",
byteObjectFieldWithMinAndMaxValue);
Assert.assertTrue(
"The byte object must have a value between: "
+ PodamTestConstants.NUMBER_INT_MIN_VALUE + " and "
+ PodamTestConstants.NUMBER_INT_MAX_VALUE,
byteObjectFieldWithMinAndMaxValue >= PodamTestConstants.NUMBER_INT_MIN_VALUE
&& byteObjectFieldWithMinAndMaxValue <= PodamTestConstants.NUMBER_INT_MAX_VALUE);
byte byteFieldWithPreciseValue = pojo.getByteFieldWithPreciseValue();
Assert.assertTrue("The byte with precise value should have value: "
+ PodamTestConstants.BYTE_PRECISE_VALUE,
byteFieldWithPreciseValue == Byte
.valueOf(PodamTestConstants.BYTE_PRECISE_VALUE));