diff --git a/test/new_relic/agent/monitors/synthetics_monitor_test.rb b/test/new_relic/agent/monitors/synthetics_monitor_test.rb index 05e242ce5e..4174ced8db 100644 --- a/test/new_relic/agent/monitors/synthetics_monitor_test.rb +++ b/test/new_relic/agent/monitors/synthetics_monitor_test.rb @@ -111,6 +111,32 @@ def test_records_synthetics_info_header_if_available end end + def test_load_json + info_payload = <<~PAYLOAD + { + "version": "1", + "type": "automatedTest", + "initiator": "cli", + "attributes": { + "attribute1": "on0e" + } + } + PAYLOAD + + expected_info = { + 'version' => '1', + 'type' => 'automatedTest', + 'initiator' => 'cli', + 'attributes' => { + 'attribute1' => 'one' + } + } + + loaded = NewRelic::Agent::SyntheticsMonitor.new(@events).load_json(info_payload, 'info-header') + + assert_equal expected_info, loaded + end + def both_synthetics_headers(payload, info_payload) header_info_key = SyntheticsMonitor::SYNTHETICS_INFO_HEADER_KEY synthetics_header(payload).merge({