-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
48 lines (48 loc) · 1.2 KB
/
doc.go
File metadata and controls
48 lines (48 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Package awsmocker allows easier mocking of AWS API responses.
//
// # Example Usage
//
// The following is a complete example using awsmocker in an example test:
//
// import (
// "testing"
// "context"
//
// "github.com/aws/aws-sdk-go-v2/aws"
// "github.com/aws/aws-sdk-go-v2/config"
// "github.com/aws/aws-sdk-go-v2/service/ecs"
// "github.com/webdestroya/awsmocker"
// )
//
//
// func TestEcsDescribeServices(t *testing.T) {
// m := awsmocker.Start(t, awsmocker.WithMocks(&awsmocker.MockedEndpoint{
// Request: &awsmocker.MockedRequest{
// Service: "ecs",
// Action: "DescribeServices",
// },
// Response: &awsmocker.MockedResponse{
// Body: map[string]any{
// "services": []map[string]any{
// {
// "serviceName": "someservice",
// },
// },
// },
// },
// }))
//
// client := ecs.NewFromConfig(m.Config())
//
// resp, err := client.DescribeServices(context.TODO(), &ecs.DescribeServicesInput{
// Services: []string{"someservice"},
// Cluster: aws.String("testcluster"),
// })
// if err != nil {
// t.Errorf(err)
// }
// if *resp.Services[0].ServiceName != "someservice" {
// t.Errorf("Service name was wrong")
// }
// }
package awsmocker