@@ -173,7 +173,7 @@ public void initTest() {
173173 @ Test
174174 public void testGetFileWithDefaultExpiration () throws Exception {
175175 // Mock S3Util to return presigned URL
176- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
176+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
177177 when (mockS3Util .generatePresignedDownloadUrl (
178178 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
179179 .thenReturn (TEST_PRESIGNED_URL );
@@ -190,7 +190,7 @@ public void testGetFileWithDefaultExpiration() throws Exception {
190190 @ Test
191191 public void testGetFileWithCustomExpiration () throws Exception {
192192 int customExpiration = 7200 ;
193- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
193+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
194194
195195 when (mockS3Util .generatePresignedDownloadUrl (
196196 eq (TEST_BUCKET ), eq (expectedKey ), eq (customExpiration )))
@@ -208,7 +208,7 @@ public void testGetFileWithCustomExpiration() throws Exception {
208208 @ Test
209209 public void testGetFileWithMinimumValidExpiration () throws Exception {
210210 int minExpiration = 1 ;
211- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
211+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
212212
213213 when (mockS3Util .generatePresignedDownloadUrl (
214214 eq (TEST_BUCKET ), eq (expectedKey ), eq (minExpiration )))
@@ -225,7 +225,7 @@ public void testGetFileWithMinimumValidExpiration() throws Exception {
225225
226226 @ Test
227227 public void testGetFileWithMaximumValidExpiration () throws Exception {
228- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
228+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
229229
230230 when (mockS3Util .generatePresignedDownloadUrl (
231231 eq (TEST_BUCKET ), eq (expectedKey ), eq (MAX_EXPIRATION )))
@@ -291,7 +291,7 @@ public void testGetFileWithNullBucket() throws Exception {
291291
292292 @ Test
293293 public void testGetFileWithS3UtilException () throws Exception {
294- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
294+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
295295
296296 // Mock S3Util to throw an exception
297297 when (mockS3Util .generatePresignedDownloadUrl (
@@ -308,7 +308,7 @@ public void testGetFileWithS3UtilException() throws Exception {
308308 @ Test
309309 public void testGetFileWithDifferentFolder () throws Exception {
310310 String differentFolder = "images" ;
311- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , differentFolder , TEST_FILE_ID );
311+ String expectedKey = String .format ("%s/%s" , differentFolder , TEST_FILE_ID );
312312
313313 when (mockS3Util .generatePresignedDownloadUrl (
314314 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
@@ -325,7 +325,7 @@ public void testGetFileWithDifferentFolder() throws Exception {
325325 @ Test
326326 public void testGetFileWithSpecialCharactersInFileId () throws Exception {
327327 String specialFileId = "file-with_special.chars-123" ;
328- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , specialFileId );
328+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , specialFileId );
329329
330330 when (mockS3Util .generatePresignedDownloadUrl (
331331 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
@@ -345,7 +345,7 @@ public void testGetFileWithSpecialCharactersInFileId() throws Exception {
345345 public void testGetFileWithValidAssetDocumentationPermissions () throws Exception {
346346 // Setup file ID with separator to test UUID extraction
347347 String fileIdWithSeparator = "abc123__filename.pdf" ;
348- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , fileIdWithSeparator );
348+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , fileIdWithSeparator );
349349
350350 when (mockS3Util .generatePresignedDownloadUrl (
351351 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
@@ -437,7 +437,7 @@ public void testGetFileWithEntityServiceException() throws Exception {
437437 public void testGetFileWithUUIDExtraction () throws Exception {
438438 // Test that UUID is correctly extracted from file ID with separator
439439 String fileIdWithSeparator = "abc123__some-filename-with-special-chars.pdf" ;
440- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , fileIdWithSeparator );
440+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , fileIdWithSeparator );
441441
442442 // The UUID "abc123" should be extracted
443443 Urn expectedFileUrn = UrnUtils .getUrn ("urn:li:dataHubFile:abc123" );
@@ -462,7 +462,7 @@ public void testGetFileWithDifferentAssetUrn() throws Exception {
462462 setupDefaultFileEntity (
463463 TEST_FILE_URN , differentAssetUrn , FileUploadScenario .ASSET_DOCUMENTATION );
464464
465- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
465+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
466466
467467 when (mockS3Util .generatePresignedDownloadUrl (
468468 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
@@ -480,7 +480,7 @@ public void testGetFileWithDifferentAssetUrn() throws Exception {
480480 public void testBuildOperationContextWithCorrectParameters () throws Exception {
481481 // This test verifies that the endpoint successfully builds an operation context and processes
482482 // the request
483- String expectedKey = String .format ("%s/%s/%s" , TEST_BUCKET , TEST_FOLDER , TEST_FILE_ID );
483+ String expectedKey = String .format ("%s/%s" , TEST_FOLDER , TEST_FILE_ID );
484484
485485 when (mockS3Util .generatePresignedDownloadUrl (
486486 eq (TEST_BUCKET ), eq (expectedKey ), eq (DEFAULT_EXPIRATION )))
0 commit comments