MCPcopy Create free account
hub / github.com/aws-samples/aws-cdk-examples / TestLambdaCronStack

Function TestLambdaCronStack

go/lambda-cron/lambda-cron_test.go:12–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestLambdaCronStack(t *testing.T) {
13 // GIVEN
14 app := awscdk.NewApp(nil)
15
16 // WHEN
17 stack := NewLambdaCronStack(app, "MyStack", nil)
18
19 // THEN
20 bytes, err := json.Marshal(app.Synth(nil).GetStackArtifact(stack.ArtifactId()).Template())
21 if err != nil {
22 t.Error(err)
23 }
24
25 template := gjson.ParseBytes(bytes)
26 handler := template.Get("Resources.Singleton8C7B99F3.Properties.Handler").String()
27 assert.Equal(t, "handler.main", handler)
28}

Callers

nothing calls this directly

Calls 1

NewLambdaCronStackFunction · 0.85

Tested by

no test coverage detected