Skip to content

Commit

Permalink
Remove negative smoke test for WAF (aws#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored and jrichardpfs committed Feb 14, 2022
1 parent d5b9a70 commit 17bad0d
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 17bad0d

Please sign in to comment.