Skip to content

Commit

Permalink
spec
Browse files Browse the repository at this point in the history
  • Loading branch information
stjmt committed Jul 30, 2024
1 parent e0141ea commit b779d46
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 47 deletions.
4 changes: 2 additions & 2 deletions spec/classes/006_elasticsearch_license_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ class { 'elasticsearch' :
it do
expect(subject).to contain_es_instance_conn_validator(
'license-conn-validator'
).that_comes_before('elasticsearch_license[xpack]')
).that_comes_before('elasticsearch_license[license]')
end

it do
expect(subject).to contain_elasticsearch_license('xpack').with(
expect(subject).to contain_elasticsearch_license('license').with(
ensure: 'present',
content: {
'license' => {
Expand Down
63 changes: 18 additions & 45 deletions spec/unit/provider/elasticsearch_license/xpack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,37 @@
ensure: :present,
provider: :ruby,
content: {
'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',
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date_in_millis' => 1_411_948_800_000,
'expiry_date_in_millis' => 1_914_278_399_999,
'max_nodes' => 1,
'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
}
}
}
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'
# }
'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',
'license' => {
'status' => 'active',
'uid' => 'cbff45e7-c553-41f7-ae4f-9205eabd80xx',
'type' => 'trial',
'issue_date_in_millis' => '1411948800000',
'expiry_date_in_millis' => '1914278399999',
'max_nodes' => 1,
'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'
}
}
end
Expand Down

0 comments on commit b779d46

Please sign in to comment.