|
| 1 | +MetaDetect Test Partitions |
| 2 | +========================= |
| 3 | + |
| 4 | +This document enumerates the equivalence partitions and boundaries exercised by the automated tests. Test method names are referenced so the mapping is explicit. |
| 5 | + |
| 6 | +Unit-Level Partitions |
| 7 | +--------------------- |
| 8 | +- AnalyzeService |
| 9 | + - Storage path present vs missing: `submitAnalysis_happyPath...`, `submitAnalysis_missingStoragePath_throws400`. |
| 10 | + - Ownership success vs Forbidden/NotFound: `submitAnalysis_propagatesOwnershipErrors`, `compare_forbiddenOnLeft_propagates`. |
| 11 | + - Download success vs empty/IO failure: `downloadToTemp_fileUrl_intoProvidedDir_copiesBytes`, `downloadToTemp_withoutExtension_defaultsToBinExtension_andFailsOnEmpty`. |
| 12 | + - C2PA success vs runtime failure: `submitAnalysis_happyPath_marksCompleted_andReturnsId`, `submitAnalysis_c2paFailure_marksFailed`. |
| 13 | + - Analysis lookup present vs missing manifest vs missing row: `getMetadata_success...`, `getMetadata_missing_throws404`, `getMetadata_notFound_throws404`, `getConfidence_missingAnalysis_throwsNotFound`. |
| 14 | + - Utility bounds: `truncate_*` (null, under-limit, over-limit) and `escapeForJson_escapesControlCharacters`. |
| 15 | + |
| 16 | +- SupabaseStorageService |
| 17 | + - Upload content-type provided vs default: `uploadObject_putsRawBytesToCorrectPath_withAuthAndApikeyHeaders`. |
| 18 | + - Signed URL parsing valid vs malformed/null: `createSignedUrl_returnsAbsoluteProjectUrl_andSendsHeaders`, `extractSignedUrlFromJson_handlesMalformed`. |
| 19 | + - Delete path blank vs 404 vs success: `deleteObject_ignoresBlankPath`, `deleteObject_404IsSwallowed`. |
| 20 | + |
| 21 | +- C2paToolInvoker |
| 22 | + - Manifest present with active id + AI generator vs empty manifests: `parseMetadata_detectsActiveManifest_andAiGenerator`, `parseMetadata_noManifest_setsFlagsToZero`. |
| 23 | + - Invalid JSON / CLI failures: `parseMetadata_invalidJson_setsErrorFlag`, `extractMetadata_cliFailure_setsErrorFlag`, `extractMetadata_nullFile_returnsError`. |
| 24 | + |
| 25 | +- FeatureExtractor |
| 26 | + - Missing image path -> C2PA-only defaults: `extractAllFeatures_missingFile_returnsC2paOnly`. |
| 27 | + - Small matrix feature computations (Laplace, noise, edges, frequency, entropy) -> non-negative bounds: `featureMethods_handleSmallMatrix`. |
| 28 | + |
| 29 | +- DTO shape/record coverage: `DtosTest.recordsRoundTrip` covers all request/response records including nullables and collections. |
| 30 | + |
| 31 | +API/Controller Partitions |
| 32 | +------------------------- |
| 33 | +- /api/analyze |
| 34 | + - POST valid image id -> 202 payload: `submit_returnsAcceptedWithBody`. |
| 35 | + - GET status success vs invalid UUID: `getStatus_returnsDtoFromService`, `getStatus_invalidUuid_returns400`. |
| 36 | + - GET manifest success: `getManifest_returnsManifestJson`. |
| 37 | + - GET compare: both params present vs missing `right`: `compare_returnsComparisonResult`, `compare_missingParam_returnsBadRequest`. |
| 38 | + |
| 39 | +- /auth |
| 40 | + - Signup/login/refresh happy paths: `signup_ok`, `login_ok`, `refresh_ok`. |
| 41 | + - Refresh missing token partition (controller validation) vs framework-invalid body: `refresh_missing_field_400_controller`, `refresh_empty_body_400_framework`. |
| 42 | + - Proxy error bubble-up: `proxy_error_bubbled`, `proxy_error_handler_sets_json`. |
| 43 | + - /auth/me authenticated with/without email vs unauthenticated: `me_authenticated_ok`, `me_authenticated_email_null`, `me_unauthenticated_401`. |
| 44 | + - Method/MediaType boundaries: `signup_method_not_allowed_405`, `signup_invalid_json_400`, `login_unsupported_media_type_415`. |
| 45 | + |
| 46 | +- /api/images |
| 47 | + - List empty/out-of-range vs populated: `listImages_outOfRangePagination_returnsEmptyList`, `listImages_success`. |
| 48 | + - Get found vs not found vs forbidden: `getImage_success`, `getImage_notFound`, `getImage_forbidden`. |
| 49 | + - Update with partial fields vs note/labels change: `updateImage_success`, `updateImage_blankFilename_isIgnored_butOtherFieldsApply`. |
| 50 | + - Upload multipart success: `upload_success_returns201AndPersistsStoragePath`. |
| 51 | + - Signed URL fetch: `signedUrl_success_returns200WithUrl`. |
| 52 | + |
| 53 | +- Security/CORS/JWT |
| 54 | + - Public vs secured resources and CORS preflight: `publicEndpoints_noAuthRequired`, `optionsPreflight_corsHeaders`. |
| 55 | + - JWT issuer boundaries (with/without slash, wrong issuer): `jwtDecoder_validIssuer_noSlash`, `jwtDecoder_validIssuer_withSlash`, `jwtDecoder_wrongIssuer_rejected`. |
| 56 | + |
| 57 | +Integration Tests |
| 58 | +----------------- |
| 59 | +- `C2paToolInvokerIntegrationTest` and `AnalyzeServiceC2paIntegrationTest`: real c2patool binary when present (external CLI integration). |
| 60 | +- `SupabaseStorageServiceTest` uses `MockWebServer` to exercise HTTP-level integration (multiple clients + logging). |
| 61 | +- `ClientServiceLiveE2eTest` (opt-in via `LIVE_E2E=true`): full stack against real Supabase auth/storage/database. |
| 62 | + |
| 63 | +Coverage Goal |
| 64 | +------------- |
| 65 | +All tests run in the Maven `test` phase and are wired for JaCoCo. The above partitions intentionally cover valid/invalid inputs and boundary conditions to drive branch coverage above the 80% requirement. |
0 commit comments