File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
spec/unit/controllers/runtime Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ def read
28
28
29
29
info [ :user ] = user . guid if user
30
30
31
+ unless @config . get ( :temporary_enable_v2 )
32
+ info [ :support ] = 'CF API v2 is disabled'
33
+ info [ :api_version ] = ''
34
+ end
35
+
31
36
Oj . dump ( info , mode : :compat )
32
37
end
33
38
end
Original file line number Diff line number Diff line change @@ -61,6 +61,25 @@ module VCAP::CloudController
61
61
expect ( hash [ 'min_recommended_cli_version' ] ) . to eq ( 'min_recommended_cli_version' )
62
62
end
63
63
64
+ it 'returns limited info when cc.temporary_enable_v2 is disabled' do
65
+ TestConfig . override ( temporary_enable_v2 : false )
66
+
67
+ get '/v2/info'
68
+ hash = Oj . load ( last_response . body )
69
+ expect ( hash [ 'name' ] ) . to eq ( TestConfig . config [ :info ] [ :name ] )
70
+ expect ( hash [ 'build' ] ) . to eq ( TestConfig . config [ :info ] [ :build ] )
71
+ expect ( hash [ 'support' ] ) . to eq ( 'CF API v2 is disabled' )
72
+ expect ( hash [ 'version' ] ) . to eq ( TestConfig . config [ :info ] [ :version ] )
73
+ expect ( hash [ 'description' ] ) . to eq ( TestConfig . config [ :info ] [ :description ] )
74
+ expect ( hash [ 'authorization_endpoint' ] ) . to eq ( TestConfig . config [ :login ] [ :url ] )
75
+ expect ( hash [ 'token_endpoint' ] ) . to eq ( TestConfig . config [ :uaa ] [ :url ] )
76
+ expect ( hash [ 'app_ssh_endpoint' ] ) . to eq ( TestConfig . config [ :info ] [ :app_ssh_endpoint ] )
77
+ expect ( hash [ 'app_ssh_host_key_fingerprint' ] ) . to eq ( TestConfig . config [ :info ] [ :app_ssh_host_key_fingerprint ] )
78
+ expect ( hash [ 'app_ssh_oauth_client' ] ) . to eq ( TestConfig . config [ :info ] [ :app_ssh_oauth_client ] )
79
+ expect ( hash [ 'api_version' ] ) . to eq ( '' )
80
+ expect ( hash [ 'osbapi_version' ] ) . to eq ( VCAP ::CloudController ::Constants ::OSBAPI_VERSION )
81
+ end
82
+
64
83
describe 'custom fields' do
65
84
context 'without custom fields in config' do
66
85
before { TestConfig . override ( info : { } ) }
You can’t perform that action at this time.
0 commit comments