@@ -193,21 +193,20 @@ public void Download_NetworkError_LogsExceptionType() throws IOException, Attest
193193 }
194194
195195 @ Test
196- public void Download_EndpointWithQueryParams_LogsOnlyHostAndPath () throws IOException , AttestationResponseHandlerException {
196+ public void Download_Http403Error_DoesNotLogPath () throws IOException , AttestationResponseHandlerException {
197197 HttpResponse <String > mockHttpResponse = mock (HttpResponse .class );
198198 when (mockHttpResponse .statusCode ()).thenReturn (403 );
199- // URL with query params (simulating potential sensitive data)
200- when (mockHttpClient .get (eq ("https://core-prod.uidapi.com/sites/refresh?token=secret123" ), any (HashMap .class ))).thenReturn (mockHttpResponse );
199+ when (mockHttpClient .get (eq ("https://core-prod.uidapi.com/sites/refresh" ), any (HashMap .class ))).thenReturn (mockHttpResponse );
201200
202201 CloudStorageException result = assertThrows (CloudStorageException .class , () -> {
203- uidCoreClient .download ("https://core-prod.uidapi.com/sites/refresh?token=secret123 " );
202+ uidCoreClient .download ("https://core-prod.uidapi.com/sites/refresh" );
204203 });
205204
206205 assertAll (
207- () -> assertTrue (result .getMessage ().contains ("core-prod.uidapi.com/sites/refresh " ),
208- "Should contain host and path " ),
209- () -> assertFalse (result .getMessage ().contains ("token=secret123 " ),
210- "Should NOT contain query parameters with tokens " )
206+ () -> assertTrue (result .getMessage ().contains ("HTTP response code 403 " ),
207+ "Should contain HTTP status code " ),
208+ () -> assertTrue (result .getMessage ().contains ("Cannot download required files from UID2 core service " ),
209+ "Should have customer-friendly message " )
211210 );
212211 }
213212}
0 commit comments