Skip to content

Commit

Permalink
Merge pull request #35 from christophd/fix/swagger-int-number-generator
Browse files Browse the repository at this point in the history
fix: Generate numbers from Swagger compliant with integer boundaries
  • Loading branch information
christophd authored Dec 12, 2019
2 parents 0052745 + ef974fe commit 053a072
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ public static String createRandomValueExpression(Property property, Map<String,
payload.append("\"");
}
} else if (property instanceof IntegerProperty || property instanceof LongProperty) {
payload.append("citrus:randomNumber(10)");
payload.append("citrus:randomNumber(8)");
} else if (property instanceof FloatProperty || property instanceof DoubleProperty) {
payload.append("citrus:randomNumber(10)");
payload.append("citrus:randomNumber(8)");
} else if (property instanceof BooleanProperty) {
payload.append("citrus:randomEnumValue('true', 'false')");
} else if (quotes) {
Expand Down Expand Up @@ -373,7 +373,7 @@ public static String createValidationExpression(AbstractSerializableParameter pa
public static String createRandomValueExpression(AbstractSerializableParameter parameter) {
switch (parameter.getType()) {
case "integer":
return "citrus:randomNumber(10)";
return "citrus:randomNumber(8)";
case "string":
if (parameter.getFormat() != null && parameter.getFormat().equals("date")) {
return "\"citrus:currentDate('yyyy-MM-dd')\"";
Expand Down

0 comments on commit 053a072

Please sign in to comment.