@@ -278,12 +278,10 @@ func TestBuildArgoLinks(t *testing.T) {
278278
279279func TestVerifications_ValidConfig (t * testing.T ) {
280280 a := New (& mockUpserter {}, & mockDeleter {}, & mockSetter {}, & mockManifestGetter {})
281- config := oapi.JobAgentConfig {
282- "serverUrl" : "argocd.example.com" ,
283- "apiKey" : "test-token" ,
284- }
281+ job := testJob ()
282+ config := job .DispatchContext .JobAgentConfig
285283
286- specs , err := a .Verifications (config )
284+ specs , err := a .Verifications (config , job . DispatchContext )
287285 require .NoError (t , err )
288286 require .Len (t , specs , 1 )
289287 assert .Equal (t , "argocd-application-health" , specs [0 ].Name )
@@ -293,14 +291,20 @@ func TestVerifications_ValidConfig(t *testing.T) {
293291
294292func TestVerifications_MissingServerUrl (t * testing.T ) {
295293 a := New (& mockUpserter {}, & mockDeleter {}, & mockSetter {}, & mockManifestGetter {})
296- specs , err := a .Verifications (oapi.JobAgentConfig {"apiKey" : "token" })
294+ specs , err := a .Verifications (
295+ oapi.JobAgentConfig {"apiKey" : "token" , "template" : "yaml" },
296+ testJob ().DispatchContext ,
297+ )
297298 require .NoError (t , err )
298299 assert .Nil (t , specs )
299300}
300301
301302func TestVerifications_MissingApiKey (t * testing.T ) {
302303 a := New (& mockUpserter {}, & mockDeleter {}, & mockSetter {}, & mockManifestGetter {})
303- specs , err := a .Verifications (oapi.JobAgentConfig {"serverUrl" : "addr" })
304+ specs , err := a .Verifications (
305+ oapi.JobAgentConfig {"serverUrl" : "addr" , "template" : "yaml" },
306+ testJob ().DispatchContext ,
307+ )
304308 require .NoError (t , err )
305309 assert .Nil (t , specs )
306310}
0 commit comments