From aae77847e5a7752ed381fa567f33b8d619e4f785 Mon Sep 17 00:00:00 2001 From: Jochen Ehret Date: Tue, 22 Oct 2024 16:05:57 +0200 Subject: [PATCH] Add spec for new cloud_controller_ng property --- .../cloud_controller_ng_spec.rb | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/spec/cloud_controller_ng/cloud_controller_ng_spec.rb b/spec/cloud_controller_ng/cloud_controller_ng_spec.rb index 4c8e0e0d47..41792e496e 100644 --- a/spec/cloud_controller_ng/cloud_controller_ng_spec.rb +++ b/spec/cloud_controller_ng/cloud_controller_ng_spec.rb @@ -104,7 +104,8 @@ module Test [{ 'description' => 'Cloud Foundry Linux-based filesystem', 'name' => 'cflinuxfs4' }], 'staging_upload_password' => '((cc_staging_upload_password))', - 'staging_upload_user' => 'staging_user' }, + 'staging_upload_user' => 'staging_user', + 'temporary_enable_v2' => true }, 'ccdb' => { 'databases' => [{ 'name' => 'cloud_controller', 'tag' => 'cc' }], 'db_scheme' => 'mysql', @@ -500,6 +501,24 @@ module Test end end + describe 'enable v2 API' do + it 'is by default true' do + template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links)) + expect(template_hash['temporary_enable_v2']).to be(true) + end + + context 'when explicitly disabled' do + before do + merged_manifest_properties['cc']['temporary_enable_v2'] = false + end + + it 'is false' do + template_hash = YAML.safe_load(template.render(merged_manifest_properties, consumes: links)) + expect(template_hash['temporary_enable_v2']).to be(false) + end + end + end + context 'when db connection expiration configuration is present' do before do merged_manifest_properties['ccdb']['connection_expiration_timeout'] = 3600