Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Feb 13, 2024
1 parent 94beec1 commit 9d3e4b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions resources/iam-virtual-mfa-devices_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package resources

import (
"context"
"github.com/gotidy/ptr"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/iam"

"github.com/ekristen/aws-nuke/mocks/mock_iamiface"
Expand All @@ -22,17 +22,17 @@ func Test_Mock_IAMVirtualMFADevice_Remove(t *testing.T) {

iamVirtualMFADevice := IAMVirtualMFADevice{
svc: mockIAM,
userName: "user:foobar",
serialNumber: "serial:foobar",
userName: ptr.String("user:foobar"),
serialNumber: ptr.String("serial:foobar"),
}

mockIAM.EXPECT().DeactivateMFADevice(gomock.Eq(&iam.DeactivateMFADeviceInput{
UserName: &iamVirtualMFADevice.userName,
SerialNumber: &iamVirtualMFADevice.serialNumber,
UserName: iamVirtualMFADevice.userName,
SerialNumber: iamVirtualMFADevice.serialNumber,
})).Return(&iam.DeactivateMFADeviceOutput{}, nil)

mockIAM.EXPECT().DeleteVirtualMFADevice(gomock.Eq(&iam.DeleteVirtualMFADeviceInput{
SerialNumber: aws.String(iamVirtualMFADevice.serialNumber),
SerialNumber: iamVirtualMFADevice.serialNumber,
})).Return(&iam.DeleteVirtualMFADeviceOutput{}, nil)

err := iamVirtualMFADevice.Remove(context.TODO())
Expand Down
7 changes: 4 additions & 3 deletions tools/list-cloudcontrol/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/ekristen/libnuke/pkg/registry"
"github.com/ekristen/libnuke/pkg/resource"

"strings"

"github.com/fatih/color"
Expand All @@ -15,6 +14,8 @@ import (
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"

"github.com/ekristen/libnuke/pkg/registry"
)

type CFTypeSchema struct {
Expand All @@ -33,7 +34,7 @@ func main() {

cf := cloudformation.New(sess)

mapping := resource.GetAlternativeResourceTypeMapping()
mapping := registry.GetAlternativeResourceTypeMapping()

in := &cloudformation.ListTypesInput{
Type: aws.String(cloudformation.RegistryTypeResource),
Expand Down

0 comments on commit 9d3e4b8

Please sign in to comment.