@@ -14,6 +14,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.typing.IntegerT
1414import io.github.typesafegithub.workflows.actionbindinggenerator.typing.IntegerWithSpecialValueTyping
1515import io.github.typesafegithub.workflows.actionbindinggenerator.typing.ListOfTypings
1616import io.github.typesafegithub.workflows.actionbindinggenerator.typing.StringTyping
17+ import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing
1718import io.kotest.core.spec.style.FunSpec
1819
1920class GenerationTest :
@@ -139,7 +140,12 @@ class GenerationTest :
139140 val coords = ActionCoords (" john-smith" , " simple-action-with-required-string-inputs" , " v3" )
140141
141142 // when
142- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
143+ val binding =
144+ coords.generateBinding(
145+ metadataRevision = NewestForVersion ,
146+ metadata = actionManifest,
147+ inputTypings = Pair (actionManifest.allInputsAsStrings(), ACTION ),
148+ )
143149
144150 // then
145151 binding.shouldContainAndMatchFile(" SimpleActionWithRequiredStringInputs.kt" )
@@ -184,7 +190,12 @@ class GenerationTest :
184190 val coords = ActionCoords (" john-smith" , " action-with-some-optional-inputs" , " v3" )
185191
186192 // when
187- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
193+ val binding =
194+ coords.generateBinding(
195+ metadataRevision = NewestForVersion ,
196+ metadata = actionManifest,
197+ inputTypings = Pair (actionManifest.allInputsAsStrings(), ACTION ),
198+ )
188199
189200 // then
190201 binding.shouldContainAndMatchFile(" ActionWithSomeOptionalInputs.kt" )
@@ -234,7 +245,12 @@ class GenerationTest :
234245 val coords = ActionCoords (" john-smith" , " action-with-outputs" , " v3" )
235246
236247 // when
237- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
248+ val binding =
249+ coords.generateBinding(
250+ metadataRevision = NewestForVersion ,
251+ metadata = actionManifest,
252+ inputTypings = Pair (actionManifest.allInputsAsStrings(), ACTION ),
253+ )
238254
239255 // then
240256 binding.shouldContainAndMatchFile(" ActionWithOutputs.kt" )
@@ -253,7 +269,12 @@ class GenerationTest :
253269 val coords = ActionCoords (" john-smith" , " action-with-no-inputs" , " v3" )
254270
255271 // when
256- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
272+ val binding =
273+ coords.generateBinding(
274+ metadataRevision = NewestForVersion ,
275+ metadata = actionManifest,
276+ inputTypings = Pair (emptyMap(), ACTION ),
277+ )
257278
258279 // then
259280 binding.shouldContainAndMatchFile(" ActionWithNoInputs.kt" )
@@ -286,7 +307,12 @@ class GenerationTest :
286307 val coords = ActionCoords (" john-smith" , " action-with-deprecated-input-and-name-clash" , " v2" )
287308
288309 // when
289- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
310+ val binding =
311+ coords.generateBinding(
312+ metadataRevision = NewestForVersion ,
313+ metadata = actionManifest,
314+ inputTypings = Pair (actionManifest.allInputsAsStrings(), ACTION ),
315+ )
290316
291317 // then
292318 binding.shouldContainAndMatchFile(" ActionWithDeprecatedInputAndNameClash.kt" )
@@ -360,9 +386,16 @@ class GenerationTest :
360386 val coords = ActionCoords (" john-smith" , " action-with-fancy-chars-in-docs" , " v3" )
361387
362388 // when
363- val binding = coords.generateBinding(metadataRevision = NewestForVersion , metadata = actionManifest)
389+ val binding =
390+ coords.generateBinding(
391+ metadataRevision = NewestForVersion ,
392+ metadata = actionManifest,
393+ inputTypings = Pair (actionManifest.allInputsAsStrings(), ACTION ),
394+ )
364395
365396 // then
366397 binding.shouldContainAndMatchFile(" ActionWithFancyCharsInDocs.kt" )
367398 }
368399 })
400+
401+ private fun Metadata.allInputsAsStrings (): Map <String , Typing > = this .inputs.mapValues { StringTyping }
0 commit comments