test/api_stub/requests/sql/database.rb in fog-azure-rm-0.1.2 vs test/api_stub/requests/sql/database.rb in fog-azure-rm-0.2.0
- old
+ new
@@ -1,12 +1,12 @@
module ApiStub
module Requests
module Sql
# Mock class for Database
class SqlDatabase
- def self.create_database_response
- '{
+ def self.create_database_response(sql_manager_client)
+ body = '{
"name" : "{database-name}",
"server_name" : "{server-name}",
"location" : "{database-location}",
"properties" : {
"createMode" : "{creation-mode}",
@@ -19,14 +19,16 @@
"restorePointInTime" : "{restore-time}",
"sourceDatabaseDeletionDate" : "{source-deletion-date}",
"elasticPoolName" : "{elastic-pool-name}"
}
}'
+ database_mapper = Azure::ARM::SQL::Models::Database.mapper
+ sql_manager_client.deserialize(database_mapper, Fog::JSON.decode(body), 'result.body')
end
- def self.list_database_response
- '{
+ def self.list_database_response(sql_manager_client)
+ body = '{
"value": [{
"name" : "{database-name}",
"server_name" : "{server-name}",
"location" : "{database-location}",
"properties" : {
@@ -41,10 +43,12 @@
"sourceDatabaseDeletionDate" : "{source-deletion-date}",
"elasticPoolName" : "{elastic-pool-name}"
}
}]
}'
+ database_mapper = Azure::ARM::SQL::Models::DatabaseListResult.mapper
+ sql_manager_client.deserialize(database_mapper, Fog::JSON.decode(body), 'result.body')
end
def self.database_hash
{
resource_group: 'resource_group',
@@ -55,11 +59,9 @@
edition: 'edition',
source_database_id: 'source_database_id',
collation: 'collation',
max_size_bytes: 'max_size_bytes',
requested_service_objective_name: 'requested_service_objective_name',
- restore_point_in_time: 'restore_point_in_time',
- source_database_deletion_date: 'source_database_deletion_date',
elastic_pool_name: 'elastic_pool_name',
requested_service_objective_id: 'requested_service_objective_id'
}
end
end