<%
  require 'json'

config = {
  addresses: p("acceptance_tests.addresses"),
  artifacts_directory: "/var/vcap/data/acceptance_tests/results",
  api: p("acceptance_tests.cloud_controller.api"),
  apps_domain: Array(p("acceptance_tests.cloud_controller.apps_domain")).first,
  admin_user: p("acceptance_tests.cloud_controller.admin_user"),
  admin_password: p("acceptance_tests.cloud_controller.admin_password"),
  use_http: p("acceptance_tests.cloud_controller.use_http"),
  skip_ssl_validation: p("acceptance_tests.skip_ssl_validation"),
  include_http_routes: p("acceptance_tests.include_http_routes"),
  default_timeout: p("acceptance_tests.default_timeout"),
  cf_push_timeout: 120,
  tcp_router_group: p("acceptance_tests.tcp_router_group"),
  oauth: {
    token_endpoint: 'https://uaa.' + p("acceptance_tests.system_domain"),
    client_name: "tcp_emitter",
    skip_ssl_validation: p("acceptance_tests.skip_ssl_validation"),
    client_secret: p("tcp_emitter.oauth_secret"),
    port: 443,
  },
}

if_p("acceptance_tests.user_password") do |password|
config[:test_password] = password
end
%>

<%= JSON.pretty_generate(config) %>
