fix some issues with test matchby
parent
ab026b66b8
commit
80fd17dae7
|
@ -836,13 +836,11 @@ func TestDriftctlRun_Middlewares(t *testing.T) {
|
|||
},
|
||||
},
|
||||
mocks: func(factory resource.ResourceFactory) {
|
||||
factory.(*terraform.MockResourceFactory).On("CreateAbstractResource", "foo", "aws_sns_topic_policy", mock.MatchedBy(func(input map[string]interface{}) bool {
|
||||
return matchByAttributes(input, map[string]interface{}{
|
||||
"id": "foo",
|
||||
"arn": "arn",
|
||||
"policy": "{\"policy\":\"bar\"}",
|
||||
})
|
||||
})).Times(1).Return(&resource.AbstractResource{
|
||||
factory.(*terraform.MockResourceFactory).On("CreateAbstractResource", "foo", "aws_sns_topic_policy", map[string]interface{}{
|
||||
"id": "foo",
|
||||
"arn": "arn",
|
||||
"policy": "{\"policy\":\"bar\"}",
|
||||
}).Times(1).Return(&resource.AbstractResource{
|
||||
Id: "foo",
|
||||
Type: aws.AwsSnsTopicPolicyResourceType,
|
||||
Attrs: &resource.Attributes{
|
||||
|
|
|
@ -57,9 +57,11 @@ func TestAwsSNSTopicPolicyExpander_Execute(t *testing.T) {
|
|||
},
|
||||
},
|
||||
mock: func(factory *terraform.MockResourceFactory) {
|
||||
factory.On("CreateAbstractResource", "ID", awsresource.AwsSnsTopicPolicyResourceType, mock.MatchedBy(func(input map[string]interface{}) bool {
|
||||
return input["id"] == "ID"
|
||||
})).Once().Return(&resource.AbstractResource{
|
||||
factory.On("CreateAbstractResource", "ID", awsresource.AwsSnsTopicPolicyResourceType, map[string]interface{}{
|
||||
"arn": "arn",
|
||||
"id": "ID",
|
||||
"policy": "{\"policy\":\"coucou\"}",
|
||||
}).Once().Return(&resource.AbstractResource{
|
||||
Id: "ID",
|
||||
Type: awsresource.AwsSnsTopicPolicyResourceType,
|
||||
Attrs: &resource.Attributes{
|
||||
|
|
Loading…
Reference in New Issue