Files
renovate/lib/modules/datasource/java-version/adoptium.spec.ts
T
Gregor Zeitlinger a53aaf4141 refactor(java-version): extract adoptium HTTP logic from datasource class (#42604)
* refactor(java-version): extract adoptium HTTP logic from datasource class

Move getPageReleases and the Adoptium fetch logic out of the
JavaVersionDatasource class into a standalone adoptium.ts module.
This makes the code easier to test in isolation and decouples
Adoptium-specific logic from the datasource class.

No behavior change — customRegistrySupport remains false, and the
hardcoded adoptiumRegistryUrl replaces the previously injected
defaultRegistryUrl (which was always the same value).

* fix(java-version): remove unused adoptiumRegistryUrl import from test

* test(java-version): use partial helper in spec

* refactor(java-version): extract adoptium HTTP logic from datasource class

* fix(java-version): pass Adoptium schema to HTTP client

* test(java-version): move Adoptium test to module spec

* chore(ci): retrigger failed checks
2026-08-18 08:13:54 +00:00

20 lines
557 B
TypeScript

import { partial } from '~test/util.ts';
import type { Http } from '../../../util/http/index.ts';
import { getAdoptiumReleases } from './adoptium.ts';
describe('modules/datasource/java-version/adoptium', () => {
it('re-throws non-HttpError', async () => {
const mockHttp = partial<Http>({
getJson: vi.fn().mockRejectedValue(new Error('unexpected')),
});
await expect(
getAdoptiumReleases(mockHttp, {
imageType: 'jdk',
architecture: null,
os: null,
}),
).rejects.toThrow('unexpected');
});
});