diff --git a/lib/modules/datasource/maven/index.spec.ts b/lib/modules/datasource/maven/index.spec.ts index 265910390b2092..a00b63dc4aac71 100644 --- a/lib/modules/datasource/maven/index.spec.ts +++ b/lib/modules/datasource/maven/index.spec.ts @@ -790,7 +790,7 @@ describe('modules/datasource/maven/index', () => { }); }); - it('returns null for deleted object', async () => { + it('handles deleted object', async () => { s3mock .on(HeadObjectCommand, { Bucket: 'bucket', @@ -805,10 +805,10 @@ describe('modules/datasource/maven/index', () => { releaseOrig, ); - expect(res).toBeNull(); + expect(res).toBe(releaseOrig); }); - it('returns null for NotFound response', async () => { + it('handles NotFound response', async () => { s3mock .on(HeadObjectCommand, { Bucket: 'bucket', @@ -823,10 +823,10 @@ describe('modules/datasource/maven/index', () => { releaseOrig, ); - expect(res).toBeNull(); + expect(res).toBe(releaseOrig); }); - it('returns null for NoSuchKey response', async () => { + it('handles NoSuchKey response', async () => { s3mock .on(HeadObjectCommand, { Bucket: 'bucket', @@ -841,10 +841,10 @@ describe('modules/datasource/maven/index', () => { releaseOrig, ); - expect(res).toBeNull(); + expect(res).toBe(releaseOrig); }); - it('returns null for unknown error', async () => { + it('handles unknown error', async () => { s3mock .on(HeadObjectCommand, { Bucket: 'bucket', @@ -859,7 +859,7 @@ describe('modules/datasource/maven/index', () => { releaseOrig, ); - expect(res).toBeNull(); + expect(res).toBe(releaseOrig); }); }); }); diff --git a/lib/modules/datasource/maven/index.ts b/lib/modules/datasource/maven/index.ts index 3738414d501237..9316ba4f122e66 100644 --- a/lib/modules/datasource/maven/index.ts +++ b/lib/modules/datasource/maven/index.ts @@ -277,7 +277,10 @@ export class MavenDatasource extends Datasource { const res = await checkResource(this.http, artifactUrl); - if (res === 'not-found' || res === 'error') { + if ( + registryUrl === MAVEN_REPO && + (res === 'not-found' || res === 'error') + ) { return 'reject'; }