Skip to content

Commit

Permalink
change example
Browse files Browse the repository at this point in the history
  • Loading branch information
stjmt committed Jul 30, 2024
1 parent 53e338c commit 55faec2
Showing 1 changed file with 56 additions and 29 deletions.
85 changes: 56 additions & 29 deletions spec/unit/provider/elasticsearch_license/xpack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,74 @@

require_relative '../../../helpers/unit/provider/elasticsearch_rest_shared_examples'

describe Puppet::Type.type(:elasticsearch_license).provider(:xpack) do # rubocop:disable RSpec/MultipleMemoizedHelpers
describe Puppet::Type.type(:elasticsearch_license).provider(:ruby) do # rubocop:disable RSpec/MultipleMemoizedHelpers
let(:name) { 'xpack' }

let(:example1) do
{
name: 'xpack',
ensure: :present,
provider: :xpack,
provider: :ruby,
content: {
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date' => '2018-02-22T23:12:05.550Z',
'issue_date_in_millis' => 1_519_341_125_550,
'expiry_date' => '2018-03-24T23:12:05.550Z',
'expiry_date_in_millis' => 1_521_933_125_550,
'max_nodes' => 1_000,
'issued_to' => 'test',
'issuer' => 'elasticsearch',
'start_date_in_millis' => 1_513_814_400_000
}
'licenses' => [{
# 'status' => 'active',
# 'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
# 'type' => 'trial',
# 'issue_date' => '2018-02-22T23:12:05.550Z',
# 'issue_date_in_millis' => 1_519_341_125_550,
# 'expiry_date' => '2018-03-24T23:12:05.550Z',
# 'expiry_date_in_millis' => 1_521_933_125_550,
# 'max_nodes' => 1_000,
# 'issued_to' => 'test',
# 'issuer' => 'elasticsearch',
# 'start_date_in_millis' => 1_513_814_400_000
'uid' => '893361dc-9749-4997-93cb-802e3d7fa4xx',
'type' => 'basic',
'issue_date_in_millis' => '1411948800000',
'expiry_date_in_millis' => '1914278399999',
'max_nodes' => 1,
'issued_to' => 'issuedTo',
'issuer' => 'issuer',
}]
}
}
end

let(:json1) do
{
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date' => '2018-02-22T23:12:05.550Z',
'issue_date_in_millis' => '1519341125550',
'expiry_date' => '2018-03-24T23:12:05.550Z',
'expiry_date_in_millis' => '1521933125550',
'max_nodes' => '1000',
'issued_to' => 'test',
'issuer' => 'elasticsearch',
'start_date_in_millis' => '1513814400000'
}
# 'license' => {
# 'status' => 'active',
# 'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
# 'type' => 'trial',
# 'issue_date' => '2018-02-22T23:12:05.550Z',
# 'issue_date_in_millis' => '1519341125550',
# 'expiry_date' => '2018-03-24T23:12:05.550Z',
# 'expiry_date_in_millis' => '1521933125550',
# 'max_nodes' => '1000',
# 'issued_to' => 'test',
# 'issuer' => 'elasticsearch',
# 'start_date_in_millis' => '1513814400000'
# }
'licenses' => [{
# 'status' => 'active',
# 'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
# 'type' => 'trial',
# 'issue_date' => '2018-02-22T23:12:05.550Z',
# 'issue_date_in_millis' => 1_519_341_125_550,
# 'expiry_date' => '2018-03-24T23:12:05.550Z',
# 'expiry_date_in_millis' => 1_521_933_125_550,
# 'max_nodes' => 1_000,
# 'issued_to' => 'test',
# 'issuer' => 'elasticsearch',
# 'start_date_in_millis' => 1_513_814_400_000
'uid' => '893361dc-9749-4997-93cb-802e3d7fa4xx',
'type' => 'basic',
'issue_date_in_millis' => '1411948800000',
'expiry_date_in_millis' => '1914278399999',
'max_nodes' => 1,
'issued_to' => 'issuedTo',
'issuer' => 'issuer',
}]
}
end

Expand All @@ -59,5 +86,5 @@
}
end

include_examples 'REST API', 'xpack/license', nil, true
include_examples 'REST API', 'license', nil, true
end

0 comments on commit 55faec2

Please sign in to comment.