Test: a lengthy real-world cloud-id test

Fixes #11435
This commit is contained in:
Karol Bucek 2019-12-12 19:45:49 +01:00 committed by Ry Biesemeyer
parent 8ccf78ab3e
commit 6ee050fda6

View file

@ -173,4 +173,30 @@ describe LogStash::Util::CloudSettingId do
expect(subject.to_s).to eq(subject.decoded)
end
end
describe "a lengthy real-world input, the accessors:" do
let(:input) do
"ZWFzdHVzMi5henVyZS5lbGFzdGljLWNsb3VkLmNvbTo5MjQzJDQwYjM0MzExNmNmYTRlYmNiNzZjMTFlZTIzMjlmOTJkJDQzZDA5MjUyNTAyYzQxODlhMzc2ZmQwY2YyY2QwODQ4"
# eastus2.azure.elastic-cloud.com:9243$40b343116cfa4ebcb76c11ee2329f92d$43d09252502c4189a376fd0cf2cd0848
end
it '#original has a value' do
expect(subject.original).to eq(input)
end
it '#decoded has a value' do
expect(subject.decoded).to eq("eastus2.azure.elastic-cloud.com:9243$40b343116cfa4ebcb76c11ee2329f92d$43d09252502c4189a376fd0cf2cd0848")
end
it '#label has a value' do
expect(subject.label).to eq("")
end
it '#elasticsearch_host has a value' do
expect(subject.elasticsearch_host).to eq("40b343116cfa4ebcb76c11ee2329f92d.eastus2.azure.elastic-cloud.com:9243")
end
it '#kibana_host has a value' do
expect(subject.kibana_host).to eq("43d09252502c4189a376fd0cf2cd0848.eastus2.azure.elastic-cloud.com:9243")
end
it '#to_s has a value of #decoded' do
expect(subject.to_s).to eq(subject.decoded)
end
end
end