Test Fix: Update test to properly reflect the Java Timestamp object. Fixes #7843

Fixes #7844
This commit is contained in:
Jake Landis 2017-07-29 16:23:40 -05:00
parent e4a4fb5430
commit 9724485777

View file

@ -9,6 +9,8 @@ require "fileutils"
require_relative "../support/helpers" require_relative "../support/helpers"
require_relative "../support/matchers" require_relative "../support/matchers"
java_import org.logstash.Timestamp
describe LogStash::Agent do describe LogStash::Agent do
let(:agent_settings) { mock_settings({}) } let(:agent_settings) { mock_settings({}) }
let(:agent_args) { {} } let(:agent_args) { {} }
@ -392,7 +394,7 @@ describe LogStash::Agent do
it "sets the success reload timestamp" do it "sets the success reload timestamp" do
snapshot = subject.metric.collector.snapshot_metric snapshot = subject.metric.collector.snapshot_metric
value = snapshot.metric_store.get_with_path("/stats/pipelines")[:stats][:pipelines][:main][:reloads][:last_success_timestamp].value value = snapshot.metric_store.get_with_path("/stats/pipelines")[:stats][:pipelines][:main][:reloads][:last_success_timestamp].value
expect(value).to be_a(LogStash::Timestamp) expect(value).to be_a(Timestamp)
end end
it "does not set the last reload error" do it "does not set the last reload error" do
@ -421,7 +423,7 @@ describe LogStash::Agent do
it "sets the failure reload timestamp" do it "sets the failure reload timestamp" do
snapshot = subject.metric.collector.snapshot_metric snapshot = subject.metric.collector.snapshot_metric
value = snapshot.metric_store.get_with_path("/stats/pipelines")[:stats][:pipelines][:main][:reloads][:last_failure_timestamp].value value = snapshot.metric_store.get_with_path("/stats/pipelines")[:stats][:pipelines][:main][:reloads][:last_failure_timestamp].value
expect(value).to be_a(LogStash::Timestamp) expect(value).to be_a(Timestamp)
end end
it "sets the last reload error" do it "sets the last reload error" do