Consider I have a course object
public Course(int id, String name, String description, int thumbnailFileId, int locationId, boolean deleted) {
this.id = id;
this.name = name;
this.description = description;
this.thumbnailFileId = thumbnailFileId;
this.locationId = locationId;
this.deleted = deleted;
}
As you can see my course has 3 values as int/long. When it comes time to send my course object to rest assured to be sent off in the request body, I am now limited to what type of tests I can do.
I cannot test the service when LocationId is greater than the max value of long it is expecting, in this instance should we use everything as String instead because then we are not restricted by values supported by the primitive types of int/long? With strings we can throw any data we like at the service e.g "2891738917321897321871", "StringInsteadOfLong"
So whats the bad sides to this? I assume we are skewing the test results somewhat? how in industry do we best overcome this problem?
Summary: I want to test values greater than maxLong or sending a word "foobar" when expecting a long at the server side but my Object variables are of type int/long for those variables because that is what the service expects and returns and I am deserializing such responses to the same object (course) that I am constructing to send in the request