Skip to content

Commit

Permalink
Add first IT for #686
Browse files Browse the repository at this point in the history
  • Loading branch information
tatu-at-datastax committed Nov 29, 2023
1 parent ecbaaa8 commit ac0c08a
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,22 @@ public void tryInsertTooLongNumber() {
"Document size limitation violated: Number value length (60) exceeds the maximum allowed (50"));
}

@Test
public void insertLongestValidString() {
int maxLen = DocumentLimitsConfig.DEFAULT_MAX_STRING_LENGTH;
final String LONGEST_STRING1 = "abcd ".repeat((maxLen - 1) / 5);
final String LONGEST_STRING2 = "bcde ".repeat((maxLen - 1) / 5);
final String LONGEST_STRING3 = "cdef ".repeat((maxLen - 1) / 5);
final String LONGEST_STRING4 = "defg ".repeat((maxLen - 1) / 5);
ObjectNode doc = MAPPER.createObjectNode();
doc.put(DocumentConstants.Fields.DOC_ID, "docWithLongString");
doc.put("text1", LONGEST_STRING1);
doc.put("text2", LONGEST_STRING2);
doc.put("text3", LONGEST_STRING3);
doc.put("text4", LONGEST_STRING4);
_verifyInsert("docWithLongString", doc);
}

@Test
public void insertLongButNotTooLongDoc() throws Exception {
JsonNode bigDoc =
Expand Down

0 comments on commit ac0c08a

Please sign in to comment.