@@ -37,7 +37,7 @@ describe('fetchCapacityMetrics', () => {
3737 it ( 'should call UtilizationService with the correct bucket key' , async ( ) => {
3838 utilizationStub . callsArgWith ( 4 , null , { } ) ;
3939
40- await fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ;
40+ await fetchCapacityMetrics ( bucketMd , request , log ) ;
4141
4242 const expectedKey = `test-bucket_${ new Date ( '2024-01-01T00:00:00.000Z' ) . getTime ( ) } ` ;
4343 assert . strictEqual ( utilizationStub . getCall ( 0 ) . args [ 0 ] , 'bucket' ) ;
@@ -48,7 +48,7 @@ describe('fetchCapacityMetrics', () => {
4848 const bucketMetrics = { bytesTotal : 42 , date : '2026-03-26T19:00:08.996Z' } ;
4949 utilizationStub . callsArgWith ( 4 , null , bucketMetrics ) ;
5050
51- const metrics = await fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ;
51+ const metrics = await fetchCapacityMetrics ( bucketMd , request , log ) ;
5252
5353 assert . strictEqual ( metrics , bucketMetrics ) ;
5454 assert ( ! logWarnSpy . called ) ;
@@ -60,12 +60,11 @@ describe('fetchCapacityMetrics', () => {
6060 error404 . response = { status : 404 } ;
6161 utilizationStub . callsArgWith ( 4 , error404 ) ;
6262
63- const metrics = await fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ;
63+ const metrics = await fetchCapacityMetrics ( bucketMd , request , log ) ;
6464
6565 assert ( metrics && metrics . date instanceof Date , 'metrics should have a Date for date' ) ;
6666 assert ( logWarnSpy . calledOnce ) ;
6767 assert ( logWarnSpy . getCall ( 0 ) . args [ 0 ] . includes ( '404' ) ) ;
68- assert . strictEqual ( logWarnSpy . getCall ( 0 ) . args [ 1 ] . method , 'testMethod' ) ;
6968 assert . strictEqual ( logWarnSpy . getCall ( 0 ) . args [ 1 ] . bucket , 'test-bucket' ) ;
7069 assert ( ! logErrorSpy . called ) ;
7170 } ) ;
@@ -75,7 +74,7 @@ describe('fetchCapacityMetrics', () => {
7574 error404 . statusCode = 404 ;
7675 utilizationStub . callsArgWith ( 4 , error404 ) ;
7776
78- const metrics = await fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ;
77+ const metrics = await fetchCapacityMetrics ( bucketMd , request , log ) ;
7978
8079 assert ( metrics && metrics . date instanceof Date , 'metrics should have a Date for date' ) ;
8180 assert ( logWarnSpy . calledOnce ) ;
@@ -87,12 +86,11 @@ describe('fetchCapacityMetrics', () => {
8786 utilizationStub . callsArgWith ( 4 , error500 ) ;
8887
8988 await assert . rejects (
90- fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ,
89+ fetchCapacityMetrics ( bucketMd , request , log ) ,
9190 err => err === error500 ,
9291 ) ;
9392
9493 assert ( logErrorSpy . calledOnce ) ;
95- assert . strictEqual ( logErrorSpy . getCall ( 0 ) . args [ 1 ] . method , 'testMethod' ) ;
9694 assert . strictEqual ( logErrorSpy . getCall ( 0 ) . args [ 1 ] . bucket , 'test-bucket' ) ;
9795 assert . strictEqual ( logErrorSpy . getCall ( 0 ) . args [ 1 ] . statusCode , 500 ) ;
9896 assert ( ! logWarnSpy . called ) ;
@@ -104,7 +102,7 @@ describe('fetchCapacityMetrics', () => {
104102 utilizationStub . callsArgWith ( 4 , connError ) ;
105103
106104 await assert . rejects (
107- fetchCapacityMetrics ( bucketMd , request , log , 'testMethod' ) ,
105+ fetchCapacityMetrics ( bucketMd , request , log ) ,
108106 err => err === connError ,
109107 ) ;
110108
@@ -174,7 +172,7 @@ describe('buildVeeamFileData', () => {
174172 metadataStub . callsArgWith ( 2 , new Error ( 'DB error' ) ) ;
175173
176174 await assert . rejects (
177- buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log , 'test' ) ,
175+ buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log ) ,
178176 err => err . code === 500 ,
179177 ) ;
180178 } ) ;
@@ -183,7 +181,7 @@ describe('buildVeeamFileData', () => {
183181 metadataStub . callsArgWith ( 2 , null , { _capabilities : { } } ) ;
184182
185183 await assert . rejects (
186- buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log , 'test' ) ,
184+ buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log ) ,
187185 err => err . code === 404 ,
188186 ) ;
189187 } ) ;
@@ -195,7 +193,7 @@ describe('buildVeeamFileData', () => {
195193 utilizationStub . callsArgWith ( 4 , error500 ) ;
196194
197195 await assert . rejects (
198- buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log , 'test' ) ,
196+ buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log ) ,
199197 err => err . code === 500 ,
200198 ) ;
201199 } ) ;
@@ -205,7 +203,7 @@ describe('buildVeeamFileData', () => {
205203 metadataStub . callsArgWith ( 2 , null , bucketMd ) ;
206204 utilizationStub . callsArgWith ( 4 , null , { date : metricsDate , bytesTotal : 100 } ) ;
207205
208- const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log , 'test' ) ;
206+ const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log ) ;
209207
210208 assert . strictEqual ( result . modified , metricsDate ) ;
211209 assert ( result . xmlContent . includes ( 'CapacityInfo' ) ) ;
@@ -223,7 +221,7 @@ describe('buildVeeamFileData', () => {
223221 error404 . response = { status : 404 } ;
224222 utilizationStub . callsArgWith ( 4 , error404 ) ;
225223
226- const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log , 'test' ) ;
224+ const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMd , log ) ;
227225
228226 assert ( result . modified instanceof Date ) ;
229227 assert ( result . modified . getTime ( ) >= before ) ;
@@ -234,7 +232,7 @@ describe('buildVeeamFileData', () => {
234232 metadataStub . callsArgWith ( 2 , null , bucketMdWithSystem ) ;
235233 const before = Date . now ( ) ;
236234
237- const result = await buildVeeamFileData ( createRequest ( systemObjectKey ) , bucketMdWithSystem , log , 'test' ) ;
235+ const result = await buildVeeamFileData ( createRequest ( systemObjectKey ) , bucketMdWithSystem , log ) ;
238236
239237 assert ( ! utilizationStub . called , 'should not call UtilizationService for system.xml' ) ;
240238 assert ( result . modified instanceof Date ) ;
@@ -261,7 +259,7 @@ describe('buildVeeamFileData', () => {
261259 metadataStub . callsArgWith ( 2 , null , bucketMdWithUsed ) ;
262260 utilizationStub . callsArgWith ( 4 , null , { date : new Date ( ) , bytesTotal : 999 } ) ;
263261
264- const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMdWithUsed , log , 'test' ) ;
262+ const result = await buildVeeamFileData ( createRequest ( capacityObjectKey ) , bucketMdWithUsed , log ) ;
265263
266264 assert ( result . xmlContent . includes ( '<Used>400</Used>' ) , 'should keep existing Used value' ) ;
267265 } ) ;
0 commit comments