File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/test/java/com/contentstack/sdk Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44import java .lang .reflect .Constructor ;
5+ import java .util .Arrays ;
56import java .util .HashMap ;
67import java .util .LinkedHashMap ;
78
@@ -105,7 +106,10 @@ void testCheckHeaderWithSpecialCharacters() {
105106 void testCheckHeaderWithLongValues () {
106107 CSBackgroundTask task = new CSBackgroundTask ();
107108 HashMap <String , Object > headers = new HashMap <>();
108- String longValue = "a" .repeat (1000 );
109+ // Create a string with 1000 'a' characters (Java 8 compatible)
110+ char [] chars = new char [1000 ];
111+ Arrays .fill (chars , 'a' );
112+ String longValue = new String (chars );
109113 headers .put ("Long-Header" , longValue );
110114
111115 assertDoesNotThrow (() -> task .checkHeader (headers ));
Original file line number Diff line number Diff line change 55import org .junit .jupiter .api .BeforeEach ;
66import org .junit .jupiter .api .Test ;
77import java .util .ArrayList ;
8+ import java .util .Arrays ;
89import java .util .LinkedHashMap ;
910import java .util .List ;
1011import static org .junit .jupiter .api .Assertions .*;
@@ -755,8 +756,8 @@ void testSetQueryJsonWithAllFields() throws IllegalAccessException {
755756 q .where ("title" , "Test" );
756757 q .except (new String []{"field1" });
757758 q .only (new String []{"field2" });
758- q .onlyWithReferenceUid (List . of ("ref_field" ), "reference" );
759- q .exceptWithReferenceUid (List . of ("except_field" ), "reference2" );
759+ q .onlyWithReferenceUid (Arrays . asList ("ref_field" ), "reference" );
760+ q .exceptWithReferenceUid (Arrays . asList ("except_field" ), "reference2" );
760761 q .includeReference ("include_ref" );
761762
762763 QueryResultsCallBack callback = new QueryResultsCallBack () {
You can’t perform that action at this time.
0 commit comments