Skip to content

Commit

Permalink
Remove negative smoke test for WAF (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored Jan 18, 2022
1 parent e10c0d2 commit 6625113
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions service/internal/integrationtest/waf/smoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ package waf

import (
"context"
"errors"
"testing"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/waf"
"github.com/aws/smithy-go"

"github.com/aws/aws-sdk-go-v2/service/internal/integrationtest"
"github.com/aws/aws-sdk-go-v2/service/waf"
)

func TestInteg_00_ListRules(t *testing.T) {
Expand All @@ -34,34 +30,3 @@ func TestInteg_00_ListRules(t *testing.T) {
t.Errorf("expect no error, got %v", err)
}
}

func TestInteg_01_CreateSqlInjectionMatchSet(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

cfg, err := integrationtest.LoadConfigWithDefaultRegion("us-west-2")
if err != nil {
t.Fatalf("failed to load config, %v", err)
}

client := waf.NewFromConfig(cfg)
params := &waf.CreateSqlInjectionMatchSetInput{
ChangeToken: aws.String("fake_token"),
Name: aws.String("fake_name"),
}
_, err = client.CreateSqlInjectionMatchSet(ctx, params)
if err == nil {
t.Fatalf("expect request to fail")
}

var apiErr smithy.APIError
if !errors.As(err, &apiErr) {
t.Fatalf("expect error to be API error, was not, %v", err)
}
if len(apiErr.ErrorCode()) == 0 {
t.Errorf("expect non-empty error code")
}
if len(apiErr.ErrorMessage()) == 0 {
t.Errorf("expect non-empty error message")
}
}

0 comments on commit 6625113

Please sign in to comment.