From 683103a52abe6953121ffa83a42a1ca61a12bdd1 Mon Sep 17 00:00:00 2001 From: Cameron Fieber Date: Mon, 10 Nov 2025 17:01:31 -0800 Subject: [PATCH] add extra test cases to parseNameOrThrow testing invalid characters in different capturing groups of the parse regex --- src/test/groovy/com/netflix/frigga/NamesSpec.groovy | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/groovy/com/netflix/frigga/NamesSpec.groovy b/src/test/groovy/com/netflix/frigga/NamesSpec.groovy index 19f2d14..151a3e3 100644 --- a/src/test/groovy/com/netflix/frigga/NamesSpec.groovy +++ b/src/test/groovy/com/netflix/frigga/NamesSpec.groovy @@ -33,12 +33,20 @@ class NamesSpec extends Specification { 889 == names.sequence } - def 'should throw for invalid name when calling parseNameOrThrow'() { + def 'should throw for invalid name when calling parseNameOrThrow: #description'() { when: - Names.parseNameOrThrow('nccp-moviecontrol%27') + Names.parseNameOrThrow(name) then: thrown(IllegalArgumentException) + + where: + name | description + 'nccp-moviecontrol%27-v000' | 'invalid stack with push' + 'nccp-moviecontrol%27' | 'invalid stack' + 'nccp-moviecontrol%27-foo-chap-baseline' | 'invalid stack with valid detail' + 'nccp-moviecontrol-foo-hello$-chap-baseline-v000' | 'invalid detail with push' + 'nccp-moviecontrol-foo-hello$-chap-baseline' | 'invalid detail' } def 'should not throw for valid name when calling parseNameOrThrow'() {