Skip to content
Snippets Groups Projects
Commit 063da826 authored by Neelesh Thakur's avatar Neelesh Thakur
Browse files

Revert "cherry pick id restriction changes"

This reverts commit ed128605
parent 5044a21d
No related branches found
No related tags found
Loading
......@@ -17,11 +17,12 @@ public class RecordUtil {
@Value("${record-id.max.length}")
private Integer recordIdMaxLength;
private static final String MAX_LENGTH_ERROR_MESSAGE = "RecordId values which are exceeded 100 symbols temporarily not allowed";
public void validateIds(List<String> inputRecords) {
if (inputRecords.stream().filter(Objects::nonNull)
.anyMatch(id -> id.length() > recordIdMaxLength)) {
String msg = "RecordId values which are exceeded 100 symbols temporarily not allowed";
throw new AppException(HttpStatus.SC_BAD_REQUEST, "Invalid id", msg);
throw new AppException(HttpStatus.SC_BAD_REQUEST, "Invalid id", MAX_LENGTH_ERROR_MESSAGE);
}
}
......
......@@ -49,6 +49,7 @@ class RecordUtilTest {
assertEquals(ERROR_MESSAGE, appException.getError().getMessage());
assertEquals(ERROR_REASON, appException.getError().getReason());
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment