mirror of
https://github.com/actions/setup-java.git
synced 2026-07-28 15:42:59 +00:00
Add force-download input
This commit is contained in:
committed by
GitHub
parent
9c42e48e88
commit
98c23c3cba
@@ -208,6 +208,29 @@ describe('setupJava', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('java is unpacked from jdkfile when force-download is enabled', async () => {
|
||||
const inputs = {
|
||||
version: actualJavaVersion,
|
||||
architecture: 'x86',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false,
|
||||
forceDownload: true
|
||||
};
|
||||
|
||||
mockJavaBase = new LocalDistribution(inputs, expectedJdkFile);
|
||||
await expect(mockJavaBase.setupJava()).resolves.toEqual({
|
||||
version: actualJavaVersion,
|
||||
path: javaPath
|
||||
});
|
||||
|
||||
expect(spyGetToolcachePath).not.toHaveBeenCalled();
|
||||
expect(spyUtilsExtractJdkFile).toHaveBeenCalledWith(expectedJdkFile);
|
||||
expect(spyTcCacheDir).toHaveBeenCalled();
|
||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
||||
);
|
||||
});
|
||||
|
||||
it("java is resolved from toolcache, jdkfile doesn't exist", async () => {
|
||||
const inputs = {
|
||||
version: actualJavaVersion,
|
||||
|
||||
Reference in New Issue
Block a user