Merge pull request #116 from kbarber/maint/master/use-v3-api-for-testing
Use the /v2 metrics endpoint instead of /metrics
This commit is contained in:
commit
a45c1ad8b5
2 changed files with 3 additions and 3 deletions
|
@ -21,7 +21,7 @@ module Puppet
|
|||
# All that we care about is that we are able to connect successfully via
|
||||
# https, so here we're simpling hitting a somewhat arbitrary low-impact URL
|
||||
# on the puppetdb server.
|
||||
path = "/metrics/mbean/java.lang:type=Memory"
|
||||
path = "/v2/metrics/mbean/java.lang:type=Memory"
|
||||
headers = {"Accept" => "application/json"}
|
||||
if @use_ssl
|
||||
conn = Puppet::Network::HttpPool.http_instance(@puppetdb_server, @puppetdb_port, @use_ssl)
|
||||
|
|
|
@ -12,12 +12,12 @@ describe 'Puppet::Util::PuppetdbValidator' do
|
|||
response_not_found.stubs(:msg).returns('Not found')
|
||||
|
||||
conn_ok = stub()
|
||||
conn_ok.stubs(:get).with('/metrics/mbean/java.lang:type=Memory', {"Accept" => "application/json"}).returns(response_ok)
|
||||
conn_ok.stubs(:get).with('/v2/metrics/mbean/java.lang:type=Memory', {"Accept" => "application/json"}).returns(response_ok)
|
||||
conn_ok.stubs(:read_timeout=).with(2)
|
||||
conn_ok.stubs(:open_timeout=).with(2)
|
||||
|
||||
conn_not_found = stub()
|
||||
conn_not_found.stubs(:get).with('/metrics/mbean/java.lang:type=Memory', {"Accept" => "application/json"}).returns(response_not_found)
|
||||
conn_not_found.stubs(:get).with('/v2/metrics/mbean/java.lang:type=Memory', {"Accept" => "application/json"}).returns(response_not_found)
|
||||
|
||||
Puppet::Network::HttpPool.stubs(:http_instance).raises('Unknown host')
|
||||
Puppet::Network::HttpPool.stubs(:http_instance).with('mypuppetdb.com', 8080, true).raises('Connection refused')
|
||||
|
|
Loading…
Reference in a new issue