diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index ebea44eb7c42bf7052bae2347395595a9a2d6d7f..ef1593f2f533dd4627389c44b6c93334f7348c79 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -35,7 +35,6 @@ describe('modules/manager/gradle/parser', () => { ${'group: "foo", name: "bar", version: depVersion'} | ${null} ${'("foo", "bar", "1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'(group = "foo", name = "bar", version = "1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} - ${'createXmlValueRemover("defaults", "integer", "integer")'} | ${{ depName: 'defaults:integer', currentValue: 'integer', skipReason: 'ignored' }} ${'"foo:bar:1.2.3@zip"'} | ${{ currentValue: '1.2.3', dataType: 'zip', depName: 'foo:bar' }} `('$input', ({ input, output }) => { const { deps } = parseGradle(input); @@ -43,6 +42,23 @@ describe('modules/manager/gradle/parser', () => { }); }); + describe('annoying methods', () => { + test.each` + input | output + ${'createXmlValueRemover("defaults", "integer", "integer")'} | ${{ depName: 'defaults:integer', currentValue: 'integer', skipReason: 'ignored' }} + ${'events("passed", "skipped", "failed")'} | ${{ depName: 'passed:skipped', currentValue: 'failed', skipReason: 'ignored' }} + ${'args("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + ${'arrayOf("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + ${'listOf("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + ${'mutableListOf("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + ${'setOf("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + ${'mutableSetOf("foo", "bar", "baz")'} | ${{ depName: 'foo:bar', currentValue: 'baz', skipReason: 'ignored' }} + `('$input', ({ input, output }) => { + const { deps } = parseGradle(input); + expect(deps).toMatchObject([output].filter(Boolean)); + }); + }); + describe('variable substitutions', () => { test.each` def | str | output diff --git a/lib/modules/manager/gradle/parser.ts b/lib/modules/manager/gradle/parser.ts index bde5535af8d6fb8e0211f3a2dbe0ee6099cac005..7f1cbc78b68eba8f6632cabc2e24355bfc74e70b 100644 --- a/lib/modules/manager/gradle/parser.ts +++ b/lib/modules/manager/gradle/parser.ts @@ -305,7 +305,11 @@ const annoyingMethods = new Set([ 'createXmlValueRemover', 'events', 'args', + 'arrayOf', 'listOf', + 'mutableListOf', + 'setOf', + 'mutableSetOf', ]); function processLongFormDep({