|  | 
| 1 | 1 | /* | 
| 2 |  | - * Copyright 2012-2023 the original author or authors. | 
|  | 2 | + * Copyright 2012-2024 the original author or authors. | 
| 3 | 3 |  * | 
| 4 | 4 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
| 5 | 5 |  * you may not use this file except in compliance with the License. | 
| @@ -113,6 +113,37 @@ void getAuthorizationServerSettingsWhenValidParametersShouldAdapt() { | 
| 113 | 113 | 		oidc.setUserInfoUri("/user"); | 
| 114 | 114 | 		AuthorizationServerSettings settings = this.mapper.asAuthorizationServerSettings(); | 
| 115 | 115 | 		assertThat(settings.getIssuer()).isEqualTo("https://example.com"); | 
|  | 116 | +		assertThat(settings.isMultipleIssuersAllowed()).isFalse(); | 
|  | 117 | +		assertThat(settings.getAuthorizationEndpoint()).isEqualTo("/authorize"); | 
|  | 118 | +		assertThat(settings.getDeviceAuthorizationEndpoint()).isEqualTo("/device_authorization"); | 
|  | 119 | +		assertThat(settings.getDeviceVerificationEndpoint()).isEqualTo("/device_verification"); | 
|  | 120 | +		assertThat(settings.getTokenEndpoint()).isEqualTo("/token"); | 
|  | 121 | +		assertThat(settings.getJwkSetEndpoint()).isEqualTo("/jwks"); | 
|  | 122 | +		assertThat(settings.getTokenRevocationEndpoint()).isEqualTo("/revoke"); | 
|  | 123 | +		assertThat(settings.getTokenIntrospectionEndpoint()).isEqualTo("/introspect"); | 
|  | 124 | +		assertThat(settings.getOidcLogoutEndpoint()).isEqualTo("/logout"); | 
|  | 125 | +		assertThat(settings.getOidcClientRegistrationEndpoint()).isEqualTo("/register"); | 
|  | 126 | +		assertThat(settings.getOidcUserInfoEndpoint()).isEqualTo("/user"); | 
|  | 127 | +	} | 
|  | 128 | + | 
|  | 129 | +	@Test | 
|  | 130 | +	void getAuthorizationServerSettingsWhenMultipleIssuersAllowedShouldAdapt() { | 
|  | 131 | +		this.properties.setMultipleIssuersAllowed(true); | 
|  | 132 | +		OAuth2AuthorizationServerProperties.Endpoint endpoints = this.properties.getEndpoint(); | 
|  | 133 | +		endpoints.setAuthorizationUri("/authorize"); | 
|  | 134 | +		endpoints.setDeviceAuthorizationUri("/device_authorization"); | 
|  | 135 | +		endpoints.setDeviceVerificationUri("/device_verification"); | 
|  | 136 | +		endpoints.setTokenUri("/token"); | 
|  | 137 | +		endpoints.setJwkSetUri("/jwks"); | 
|  | 138 | +		endpoints.setTokenRevocationUri("/revoke"); | 
|  | 139 | +		endpoints.setTokenIntrospectionUri("/introspect"); | 
|  | 140 | +		OAuth2AuthorizationServerProperties.OidcEndpoint oidc = endpoints.getOidc(); | 
|  | 141 | +		oidc.setLogoutUri("/logout"); | 
|  | 142 | +		oidc.setClientRegistrationUri("/register"); | 
|  | 143 | +		oidc.setUserInfoUri("/user"); | 
|  | 144 | +		AuthorizationServerSettings settings = this.mapper.asAuthorizationServerSettings(); | 
|  | 145 | +		assertThat(settings.getIssuer()).isNull(); | 
|  | 146 | +		assertThat(settings.isMultipleIssuersAllowed()).isTrue(); | 
| 116 | 147 | 		assertThat(settings.getAuthorizationEndpoint()).isEqualTo("/authorize"); | 
| 117 | 148 | 		assertThat(settings.getDeviceAuthorizationEndpoint()).isEqualTo("/device_authorization"); | 
| 118 | 149 | 		assertThat(settings.getDeviceVerificationEndpoint()).isEqualTo("/device_verification"); | 
|  | 
0 commit comments