@@ -366,4 +366,79 @@ public void testDirectEditing() {
366366 assertFalse ("Wrongly reporting that direct editing is supported" , capabilities1 .isDirectEditingAvailable ());
367367
368368 }
369+
370+
371+ @ Test
372+ public void testSharingDisabled () {
373+ //language=json
374+ final String response = "" +
375+ "{" +
376+ " \" version\" : {" +
377+ " \" major\" : 20," +
378+ " \" minor\" : 0," +
379+ " \" micro\" : 7," +
380+ " \" string\" : \" 20.0.7\" ," +
381+ " \" edition\" : \" \" ," +
382+ " \" extendedSupport\" : false" +
383+ " }," +
384+ " \" capabilities\" : {" +
385+ " \" core\" : {" +
386+ " \" pollinterval\" : 60," +
387+ " \" webdav-root\" : \" remote.php/webdav\" " +
388+ " }," +
389+ " \" notes\" : {" +
390+ " \" api_version\" : [" +
391+ " \" 0.2\" ," +
392+ " \" 1.1\" " +
393+ " ]," +
394+ " \" version\" : \" 4.0.4\" " +
395+ " }," +
396+ " \" files_sharing\" : {" +
397+ " \" api_enabled\" : true," +
398+ " \" public\" : {" +
399+ " \" enabled\" : false," +
400+ " \" expire_date\" : {" +
401+ " \" enabled\" : false" +
402+ " }," +
403+ " \" multiple_links\" : true," +
404+ " \" expire_date_internal\" : {" +
405+ " \" enabled\" : false" +
406+ " }," +
407+ " \" send_mail\" : false," +
408+ " \" upload\" : true," +
409+ " \" upload_files_drop\" : true" +
410+ " }," +
411+ " \" resharing\" : false," +
412+ " \" user\" : {" +
413+ " \" send_mail\" : false," +
414+ " \" expire_date\" : {" +
415+ " \" enabled\" : true" +
416+ " }" +
417+ " }," +
418+ " \" group_sharing\" : false," +
419+ " \" group\" : {" +
420+ " \" enabled\" : true," +
421+ " \" expire_date\" : {" +
422+ " \" enabled\" : true" +
423+ " }" +
424+ " }," +
425+ " \" default_permissions\" : 31," +
426+ " \" federation\" : {" +
427+ " \" outgoing\" : true," +
428+ " \" incoming\" : true," +
429+ " \" expire_date\" : {" +
430+ " \" enabled\" : true" +
431+ " }" +
432+ " }," +
433+ " \" sharee\" : {" +
434+ " \" query_lookup_default\" : false" +
435+ " }" +
436+ " }" +
437+ " }" +
438+ "}" ;
439+ final var capabilities = deserializer .deserialize (JsonParser .parseString (response ), null , null );
440+ assertNull (capabilities .getETag ());
441+ assertEquals ("[\" 0.2\" ,\" 1.1\" ]" , capabilities .getApiVersion ());
442+ assertFalse ("Wrongly reporting that direct editing is supported" , capabilities .isDirectEditingAvailable ());
443+ }
369444}
0 commit comments