diff --git a/backend/controller/dal/async_calls_test.go b/backend/controller/dal/async_calls_test.go index c1ea520cc8..9417d3e3d1 100644 --- a/backend/controller/dal/async_calls_test.go +++ b/backend/controller/dal/async_calls_test.go @@ -22,3 +22,20 @@ func TestNoCallToAcquire(t *testing.T) { assert.IsError(t, err, dalerrs.ErrNotFound) assert.EqualError(t, err, "no pending async calls: not found") } + +func TestParseAsyncOrigin(t *testing.T) { + cronKeys := []string{ + "crn-cron-cron-10pvs393nkv3new4", // 1:23: exponent has no digits + "crn-initial-verb0-3poj0hr6wmtvmz99", // 1:26: exponent has no digits + "crn-initial-verb0Cron-5eq2ivpmuv0lvnoc", // 1:30: exponent has no digits + } + for _, cronKey := range cronKeys { + origin, err := ParseAsyncOrigin("cron:" + cronKey) + assert.NoError(t, err) + assert.Equal(t, "cron", origin.Origin()) + + asyncOrigin, ok := origin.(*AsyncOriginCron) + assert.True(t, ok, "origin is not a cron origin") + assert.Equal(t, cronKey, asyncOrigin.CronJobKey) + } +}