Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit 3c098e2

Browse files
committed
Tests fixes
1 parent 344135f commit 3c098e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/NotBlankConstraint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public boolean isValid(Object value, ConstraintValidatorContext context) {
3838
return true;
3939
}
4040

41-
String escapedValue = MessageSanitizer.escape(value.toString());
41+
String escapedValue = MessageSanitizer.escape(value == null ? null : value.toString());
4242
String errorMessage = String.format("Expected not empty value, got '%s'", escapedValue);
4343
LOG.warn(errorMessage);
4444

4545
context.buildConstraintViolationWithTemplate(errorMessage).addConstraintViolation();
4646
return false;
4747
}
4848
}
49-
}
49+
}

browserup-proxy-rest/src/main/java/com/browserup/bup/rest/validation/PortWithExistingProxyConstraint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public boolean isValid(Integer value, ConstraintValidatorContext context) {
4949
}
5050

5151
String escapedValue = MessageSanitizer.escape(value.toString());
52-
String errorMessage = String.format("No proxy server found for specified port %d", escapedValue);
52+
String errorMessage = String.format("No proxy server found for specified port %s", escapedValue);
5353
LOG.warn(errorMessage);
5454

5555
context.buildConstraintViolationWithTemplate(errorMessage).addPropertyNode(PARAM_NAME).addConstraintViolation();
5656
return false;
5757
}
5858
}
59-
}
59+
}

0 commit comments

Comments
 (0)