2015-01-02 12:34:40 -05:00
|
|
|
Shindo.tests('AWS::SNS | topic lifecycle tests', ['aws', 'sns']) do
|
2014-12-30 17:25:09 -05:00
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#create_topic('fog_topic_tests')").formats(AWS::SNS::Formats::BASIC.merge('TopicArn' => String)) do
|
2014-12-30 17:25:09 -05:00
|
|
|
body = Fog::AWS[:sns].create_topic('fog_topic_tests').body
|
|
|
|
@topic_arn = body["TopicArn"]
|
|
|
|
body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#list_topics").formats(AWS::SNS::Formats::BASIC.merge('Topics' => [String])) do
|
2014-12-30 17:25:09 -05:00
|
|
|
Fog::AWS[:sns].list_topics.body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#set_topic_attributes('#{@topic_arn}', 'DisplayName', 'other-fog_topic_tests')").formats(AWS::SNS::Formats::BASIC) do
|
2014-12-30 17:25:09 -05:00
|
|
|
Fog::AWS[:sns].set_topic_attributes(@topic_arn, 'DisplayName', 'other-fog_topic_tests').body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
get_topic_attributes_format = AWS::SNS::Formats::BASIC.merge({
|
2014-12-30 17:25:09 -05:00
|
|
|
'Attributes' => {
|
|
|
|
'DisplayName' => String,
|
|
|
|
'Owner' => String,
|
|
|
|
'Policy' => String,
|
|
|
|
'SubscriptionsConfirmed' => Integer,
|
|
|
|
'SubscriptionsDeleted' => Integer,
|
|
|
|
'SubscriptionsPending' => Integer,
|
|
|
|
'TopicArn' => String
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
tests("#get_topic_attributes('#{@topic_arn})").formats(get_topic_attributes_format) do
|
|
|
|
Fog::AWS[:sns].get_topic_attributes(@topic_arn).body
|
|
|
|
end
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
tests("#delete_topic('#{@topic_arn}')").formats(AWS::SNS::Formats::BASIC) do
|
2014-12-30 17:25:09 -05:00
|
|
|
Fog::AWS[:sns].delete_topic(@topic_arn).body
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
tests('failure') do
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|