CardDavFilterTest.kt (web layer)CardDavFilter.handledByCardDavFilter() — the servlet filter decision logic. More compact than the domain-layer CardDavFilterTest (#1861), focusing on well-known URIs, DAV methods, and negative cases. Tests that only OPTIONS/PROPFIND/REPORT on known paths are intercepted, while GET requests and unknown paths pass through.This is a second CardDavFilterTest, located in the org.projectforge.web package (web layer). It tests the same CardDavFilter.handledByCardDavFilter() static method but with a different focus: web-layer routing concerns and the .well-known discovery endpoint.
Unlike #1861's flat list of test cases, this test organizes assertions using a helper method hierarchy:
checkRequest(uri, method, expected) — Creates a mocked request and asserts the filter decisioncheckMethod(method) — Tests a method against multiple URIs (generic path, "users", "/carddav/users/")| Test | URI | Method | Expected | Rationale |
|---|---|---|---|---|
| Well-known discovery | /.well-known/carddav | PROPFIND | true | RFC 6764 service discovery — clients probe this path first |
| CardDAV users | /carddav/users/ | PROPFIND | true | Standard CardDAV user collection path |
| Wicket app | /wa/... | PROPFIND | false | Wicket application path — must NOT be intercepted |
| Generic GET | .... | GET | false | GET on unknown path — not CardDAV |
| Users GET | /users | GET | false | GET without DAV headers on users path — likely web app request |
| Method check: generic | .... | OPTIONS/PROPFIND/REPORT | false | DAV methods on unknown URIs pass through |
| Method check: users | users | OPTIONS/PROPFIND/REPORT | true | DAV methods on "users" path are intercepted |
| Method check: carddav | /carddav/users/ | OPTIONS/PROPFIND/REPORT | true | Full CardDAV path with DAV methods |
| Aspect | #1861 (domain) | #1869 (web) |
|---|---|---|
| Package | org.projectforge.carddav | org.projectforge.web |
| Well-known URI | Tests OPTIONS + GET | Tests PROPFIND only |
| Wicket path | Not tested | Tests /wa/... (Wicket application) |
| Method iteration | Inline checks | Parameterized checkMethod() with arrayOf().forEach |
| VCF patterns | Detailed VCF filename testing | Not covered |
| REPORT method | Not tested | Tested (REPORT on users/carddav paths) |
CardDavFilter.handledByCardDavFilter()) but from different package contexts and with different coverage. This represents test duplication likely resulting from parallel development streams that weren't fully consolidated. The domain-layer test (#1861) is more comprehensive for VCF patterns; the web-layer test (#1869) adds Wicket path exclusion and REPORT method checks.Same pattern as #1861: creates Mockito.mock(HttpServletRequest::class.java), stubs method and requestURI, asserts the boolean return value.
868d6abb7 2025 -> 2026 63081666f Source file headers: 2024-> 2025. 40e554cbe WIP: Carddav 2ad0cfe66 WIP: Carddav ad8b47d1f WIP: CardDavWIP: CardDav 7f2c255ae WIP: CardDav